Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Takiro |
I’m working on a simple application that shows a list of controls. When a new control gets added to the list I want to make it look like it grows vertically. I created a tween for rect_size.y but it doesn’t work.
Tweening rect_size.x works just fine but when I try to make it grow/shrink vertically it doesn’t do anything.
I assume it could be because the items get added to a VBoxContainer and the container somehow prevents changing the height of the items.
Is there anything I can do to make this work?
Here is the my tweening function, it gets called when the control enters the scene
func grow():
in_tween.interpolate_property(self, "rect_size:y", 0 , rect_size.y, 1.5, Tween.TRANS_LINEAR, Tween.EASE_OUT)
var end_color = Color(1.0, 1.0, 1.0, 1.0)
var start_color = Color(1.0, 1.0, 1.0, 0.0)
in_tween.interpolate_property(self, "modulate", start_color, end_color, 0.5, Tween.TRANS_LINEAR, Tween.EASE_IN)
if not in_tween.is_active():
in_tween.start()
With the last two lines, you don’t start the tweening if one is already running. Could it be that you’re tween us already running for another node? Make sure the tweening is starting.
MrEliptik | 2021-03-25 22:54
I doubt that’s the case since it works when I chance rect_size.y to x and the color transition plays regardless.
Takiro | 2021-03-26 00:16