- Edited
I couldn't find a comfortable solution for this searching the internet.
I've made a spritesheet with a dozen sprites of different species and my plan was to use it and select the appropriate region changing just an enum or integer. Similar to what you can do with AnimatedSprites. That way I can use say one button and switch its texture with just changing the int and I don't have to worry about the texture.
However I haven't found how godot has thought of this. You have the AtlasTexture but setting the region rect is not straightforward in gdscript, and in the editor I have to set the pixel offset every time since I couldn't find a way to establish the sprite "tiles" size of 32x32 and just use ints for selecting the frame I want.
Most people have one texture per entity so I guess they set it dragging in the editor or loading it and setting it at _ready via some filename naming logic. Seems a bit more convoluted than it ought to be. Or use the atlas selecting the region and store N resources and then code the naming logic (i guess).
It feels like there should be a godot way of saying this texture is a spritesheet of 32x32 sprites and use the nth sprite
Maybe you senseis know of a better way of doing this or I might be missing something relevant.