Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Toscan0 |
Hey,
I want to do something like this
How can i make the icons fit the screen and not overflow?
Thanks
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Toscan0 |
Hey,
I want to do something like this
How can i make the icons fit the screen and not overflow?
Thanks
Reply From: | MxtApps |
I do not know if this is exactly that you want but I tell you how:
-select the HBoxContainer and in the inspector open the transform tab
-check the x and the y size
-attach an script to the HBoxContainer
-write the following code:
extends HBoxContainer
onready var first = $CharacterIconPreview1
onready var second = $CharacterIconPreview2
onready var third = $CharacterIconPreview3
onready var four = $CharacterIconPreview4
var requested_size = Vector2(5, 5) #Input here the values that you previously got.
func _ready():
first.set_size(requested_size)
second.set_size(requested_size)
third.set_size(requested_size)
four.set_size(requested_size)
Warning with the identations
I hope this will be useful for you!!
I do not have a transform tab, do u mean Rect Position?
Toscan0 | 2021-06-28 18:03