A node that can merge textures.
TextureMerger is a utility node that allows you to combine multiple [Texture] objects into a single [AtlasTexture]. It provides methods for adding, modifying, and removing textures, as well as controlling their position and cropping. Once all textures are set up, the `merge` method can be called to create the final combined texture.
Called when a new texture is added to the merger. Can be overridden in extended classes to implement custom behavior.
Called when the textures are merged. Can be overridden in extended classes to implement custom behavior.
Called when a texture is removed from the merger. Can be overridden in derived classes to implement custom behavior.
Adds a new texture to the merger and returns the corresponding [AtlasTexture].
Removes all textures from the merger.
Returns whether the merger is marked as dirty, indicating that the merged texture needs to be updated.
Returns the generated [ImageTexture] at the specified index after merging.
Returns the total number of generated textures in the merger.
Returns the original [Texture] object at the specified index.
Returns the [TexturePacker] instance used by the merger.
Returns the [AtlasTexture] corresponding to the given [Texture] object.
Returns the total number of textures in the merger.
Returns the [AtlasTexture] at the specified index.
Merges all textures into a single [AtlasTexture]. Call `get_generated_texture` after this method to get the merged result.
Removes the specified texture from the merger.
Removes the texture at the specified index from the merger.
Sets the dirty flag for the merger, indicating that the merged texture needs to be updated.
Sets the [TexturePacker] instance to be used by the merger.
Decreases the reference count of the specified texture and removes it from the merger if the reference count reaches zero. Returns true if the texture was removed.
Decreases the reference count of the texture at the specified index and removes it from the merger if the reference count reaches zero. Returns true if the texture was removed.
If true, textures will be automatically merged when added or removed.
The background color of the generated [AtlasTexture].
If true, original atlases will be kept in memory after merging.
The margin between textures in the generated [AtlasTexture].
The maximum size of the generated [AtlasTexture].
[Texture] flags to apply to the generated [AtlasTexture].
Array of textures to be merged.
Emitted when a new texture is added to the merger.
Emitted when the textures are merged.
Emitted when a texture is removed from the merger.