mirror of
https://github.com/bevyengine/bevy
synced 2024-12-22 02:53:07 +00:00
b2e2f8d9e3
# Objective TextureAtlases are commonly used to drive animations described as a consecutive range of indices. The current TextureAtlasBuilder uses the AssetId of the image to determine the index of the texture in the TextureAtlas. The AssetId of an Image Asset can change between runs. The TextureAtlas exposes [`get_texture_index`](https://docs.rs/bevy/latest/bevy/sprite/struct.TextureAtlas.html#method.get_texture_index) to get the index from a given AssetId, but this needlessly complicates the process of creating a simple TextureAtlas animation. Fixes #2459 ## Solution - Use the (ordered) image_ids of the 'texture to place' vector to retrieve the packed locations and compose the textures of the TextureAtlas. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |