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

Popular posts from this blog

[Godot Engine] How to set a game to center in multi resolution screens

The Godot engine has many layout options to fit the game to multi-resolution screens. You can use  one of default options , if you don't want to fill the full screen with the game or you allow to change the ratio of the game screen. However, Using only default options, it's not so easy to set elements in the game to proper position with fill the multi resolution screen and keep the ratio of the width and height of the game. the requirements are as follows: The background have to fill the multi resolution screens. The elements in the game have to properly positioned with the size of screen. There might be many way to solve this problem, but I'll show you the simplest way what i think and tried. 1. Separate the background and contents in the game. Separate the background and contents in the game. Fill the screen using the background and resize and reposition the contents. Create a new scene and name ...