Skip to main content

[Godot engine] How to set the AnimatedTexture to the TextureButton node

In the Godot engine, the TextureButton can use a variety of textures.


In this post, I'll show how to set an AnimatedTexture to the TextureButton node. The AnimatedTexture shows an animation effect using the image frames.

To do this, I prepared simple images as a frames of the animation.

I create a "images" folder to save the images. Godot engine have to import these images to use. The importing is done by drag and drop. 


Add TextureButton node to the Scene.

The texture list to set will be shown when you select inserted TextureButton, expand Textures menu in Inspector tab in right side of editor. I'll set AnimatedTexture in the Normal case, because I want to show text animation all the time.

I Selected "[empty]" drop box beside Normal and select "New AnimatedTexture" menu.

There are 5 images and the images show the text getting small. I want to show the text size up and down repeatedly. So, I need 8 frames. When I change the number in "Frames", the number of frame elements are changed.

There are "Texture" and "Delay Sec" in each Frame, the frame image can be set in "Texture" and the delay time in the frame can be set in "Delay sec".

I drag and drop the images to each frames.

After set the frame images, change the "Fps" and "delay" to find proper animation effect.

The animation effect has applied to the TextureButton.


Comments