Animation in a Control node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Vicente Juárez

Hello! I’m a seasoned developer, but a complete novice with the Godot engine. I started a new project and I have been playing with GUI design, but I got a little stuck. I want to add an animated sprite as part of the GUI, following the container layout and such, but there isn’t any Control node like that. Adding something like an AnimatedSprite doesn’t seem to follow the container’s constrains. I could use the VideoPlayer node, but that would add extra complexity and would be inconsistent with the rest of the game, where I would just use AnimatedSprite (the parts that aren’t GUI). I kind of hacked it with a TextureRect with an attached script that updates the image, but I don’t think that’s the most efficient approach and it’s also inconsistent with the rest of the game. What am I missing here?


I used an animated sprite as a child of the control node and it seems to work fine but you’re right, it doesn’t fit with the convention and I’m dying to know the best practice for this. My dirty work arounds must end.

TheIronGod | 2023-01-09 05:02