Godot Version
4.4.1.stable
Question
I have a Background Scene, which is a Sprite2D, that should cover the whole background of the screen with a specific texture. When doing this with a non-AtlasTexture (a single 16x16 pixels tile sprite), enabling Region, setting the proper Region Rect values and enabling Texture Repeat, the result is the intended one:
But, I want to use a Spritesheet with a whole bunch of possible tile sprites for the background, and that’s because of three reasons:
-
1.- During the game the Player will be able to customize the background tiles (not the color), so I think it would be less memory-intensive to modify the AtlasTexture’s Region to select the desired tile, than to have individual files for each tile.
-
2.- Having a single Spritesheet file instead of individual files for each possible tile would be way more organized and easy to manage.
-
3.- If I want to modify the tiles in any way, it would be way faster to modify a single Spritesheet image than to modify the tile images one by one, especially if I wanted to try different colors (all of the tiles will always have the same two colors).
The documentation says that AtlasTextures will not tile properly in nodes such as TextureRect or Sprite2D, and that to tile an AtlasTexture its Region must be modified.
I have tried to modify the Region to make the AtlasTexture tile, but couldn’t get the desired result:
The most I could accomplish was to tile the whole AtlasTexture image, but that is not what I want. I want a single tile from the AtlasTexture to be repeated across the whole screen.
What is the proper way to do this?
Example Project
Here is an Example Project where you can see the AtlasTexture not tiling properly: ExampleProject.rar - Google Drive