Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | vipsbpig | |
Old Version | Published before Godot 3 was released. |
How to wrap ui like this? I wanted to loop the ui endlessly.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | vipsbpig | |
Old Version | Published before Godot 3 was released. |
How to wrap ui like this? I wanted to loop the ui endlessly.
Reply From: | willnationsdev |
It looks like this was done by changing a float value as the user clicks and drags over some UI container (HboxContainer?) and then, using a setget setter for that variable, dynamically generating some delta (changed) coordinates for every child of the container. If you used a modulus when applying the calculated new coordinates, you can then cause the coordinate to “loop” by having it teleport to the higher number x-coordinate when it falls into the 0-(panel_width+inter_panel_space) amount.
That’s just a wild guess based on the observation, but it certainly seems plausible (or something along those lines anyway).
You’d have to have another function in the setter, perhaps using the tween animation system, that automatically scales the panels’ sizes based on the float value to get that “expanding-in-the-middle” animation.