Texture buttons - multiple textures from one file

Godot Version

4.6.1

Hi. I’m setting up a character selection menu with multiple texture buttons for character portraits. Rather than have a separate image file for each button is it possible to have each image saved together as one file and get the portrait required from a coordinate system?

Yes, it’s called a spritesheet. You need to put your button textures in a single file, then you need to add an AtlasTexture to your Texture button, make the “Atlas” property your image file, then set the correct region of your spritesheet.

Thanks. I assume this will also work for texture panels so each button will show a larger version of the portrait when clicked?

I’m not sure what you mean by texture panel, I don’t know which node that is, but the AtlasTexture resource is available for almost everything that can have a Texture.

1 Like