0 votes

I'm using a TextureButton and I want the following functionality.
On the Textures.Normal I want a single sprit image (no problem, that works).
On the Textures.Pressed, I want an Animated Sprite. I can't get this to work. It wants AnimatedTexture with is a static sprite that you animate through its process. I want to use an AnimatedSprite that has it's own Animation states. Depending on how long the button is pressed I want to change the animation based on the AnimatedSprite states.

How do I use an animated Sprite in the Texture.Pressed?

in Engine by (33 points)

2 Answers

0 votes

I think you can do it when you make a Animationplayer.

if Button_pressed:

by (256 points)

I can't get this to work.

I have 4 sprites that create the animation. It is not just a simple slide or rotation of one image. I see no way to use and animatedsprite with animationplayer.

This doesn't seem to work.

0 votes

This worked like a charm!

I used the following tree

I made the button transparent by using the inspector->visibility->modulate and set the A channel to 0 making it transparent. This allowed the button to receive the signals. I think made the button the same size as my sprite and put them on top of one another. Using the timer I was able to animate the sprite when I needed to, depending on the timing of signals from the button

by (33 points)
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 [email protected] with your username.