bevy_mod_ui_texture_atlas_image
Draw images from texture atlases with the Bevy UI.
- Version 0.2 supports Bevy 0.9
- Version 0.1 supports Bevy 0.8
Details
Add the dependency to your project's Cargo.toml:
= "0.2.2"
Then add the UiAtlasImagePlugin
plugin to your Bevy App:
use *;
Now you can spawn an AtlasImageBundle
to draw images from a TextureAtlas
with the Bevy UI.
commands
.spawn;
The only difference between an AtlasImageBundle
and an ImageBundle
is that instead of an image
field with type UiImage
, it has an atlas_image
field with type UiAtlasImage
.
Examples
- Displaying a single image from a texture atlas:
cargo --run --example minimal
- Displaying three tiles from a texture atlas grid alongside the atlas's source image:
cargo --run --example tiles