A utility class that can merge textures as layers together.
TextureLayerMerger is a utility class that allows you to combine multiple [Texture2D] objects into a single [ImageTexture]. It provides methods for adding, modifying, and removing textures, as well as controlling their position, color, and cropping. Once all textures are set up, the `merge` method can be called to create the final combined texture.
Adds a new texture layer with the specified texture, color, position, and optional cropping rectangle.
Removes all texture layers from the merger.
Returns the color of the texture layer at the specified index.
Returns the position of the texture layer at the specified index.
Returns the cropping rectangle of the texture layer at the specified index.
Returns the merged result as an [ImageTexture]. Call `merge` before using this method to get the updated result.
Returns the [Texture2D] object of the texture layer at the specified index.
Returns the total number of texture layers in the merger.
Merges all texture layers into a single [ImageTexture]. Call `get_result_as_texture` after this method to get the merged result.
Removes the texture layer at the specified index.
Sets the color of the texture layer at the specified index.
Sets the position of the texture layer at the specified index.
Sets the cropping rectangle of the texture layer at the specified index.
Sets the [Texture2D] object of the texture layer at the specified index.
The base color used as the background for the merged texture.
The [Image] data of the merged texture.
The height of the merged texture.
[Texture] flags applied to the merged texture.
The width of the merged texture.