Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | make |
Hi,
I need to create a dynamic list of images and be able to scroll them.
This is my scene:
ScrollContainer
—> HBoxContainer
------> TextureRect1
------> TextureRect2
------> TextureRect3
------> TextureRect4
It works, but I need the list to be dynamic.
I tried to turn off the visibility of TextureRext4 with this GDScript code: $ScrollContainer/HBoxContainer/TextureRect4.visible = false.
The fourth image disappears but the size of the HBoxContainer still has room for 4 images and not 3.
I tried to resize de HBoxContainer ($ScrollContainer/HBoxContainer.rect_size.x = …) in according to the number of images but it doesn’t work… when I scroll the images I still have the empty space for the fourth image at the end.
How can I do in order to achieve the result I need?
Thank you for your help.