How make animated UI

Godot Version

4.2.2

Question

I made a Coin collection UI.It looks like:

The AnimatedSprite2D node shouldn’t use to UI.But I don’t know which UI node can replace.
in this version, there is a problem with alignment

by the way,I only have coin picture like this:

how make this pic good use to animated UI control

1 Like

You can either use a Sprite2D and then edit the region to the image you want to show.

Or use the AnimatedSprite2D node and then just select 1 frame of the coin spritesheet.

1 Like

I know this way, and that’s what I’m doing right now.

Sorry,I think that I didn’t say clearly.
I want coin UI have animate,not just a static pic.so I use AnimateSprite2D to make this.
but I also think, In UI control container only can use UI node.should not use AnimateSprite2D.(it has aligenment problem, It can only be adjusted manually.)
I want find the better way (the correct way) to achieve this animation effect.

You can use Node2D nodes with Control (UI) nodes. It’s just that they don’t have the fancy sizing behavior Control nodes have

I would put a Control node as parent of the AnimatedSprite2D. Match the size and alignment manually and you get pretty nice behavior as long as you don’t need to resize the AnimatedSprite2D