Topic was automatically imported from the old Question2Answer platform.
Asked By
JoeSeki
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?
I think you can do it when you make a Animationplayer.
if Button_pressed:
$Animationplayer.play(“test”)
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.
I used the following tree
Node2D
-Button
-AnimatedSprite
-Timer
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