0 votes

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...

in Engine by (825 points)

1 Answer

+2 votes
Best answer

You can do it like this:

my special button scene
TextureButton (script)
↳ AnimatedSprite

by (693 points)
selected by

FACE PALM!

That's SO obvious now you've said it. Thank you good person. :-)

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

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.