Animated TextureButton?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Robster
:warning: Old Version Published before Godot 3 was released.

Hi all,

I want to have clickable “tiles” for my latest project.

I looked at using a sprite but they have no signals that I can use it seems so I am looking at the textureButton. They have a released() signal, look and work perfectly.

Unfortunately though, my tile needs to be animated. They need to cycle a few images in a sprite sheet. This works great when using a sprite, but I can’t figure out how to do it with a textureButton.

Can anyone offer some advice on how to make a workaround for this?

Thanks so much…

:bust_in_silhouette: Reply From: puppetmaster-

You can do it like this:

my special button scene
TextureButton (script)
↳ AnimatedSprite

FACE PALM!

That’s SO obvious now you’ve said it. Thank you good person. :slight_smile:

I assume there is no image in the textureButton but it will still accept input. Thanks again, I’ll try that shortly.

Robster | 2016-12-08 08:25

FYI in theory you could just use Control if you have no use for TextureButton textures, but that involves a little bit of code on it so you can expose a clicked signal.

Zylann | 2016-12-08 12:50