Skip to content
Discussion options

You must be logged in to vote

The new SpriteSheetBundle is now a SpriteBundle with one additional component: TextureAtlas

That component stores both the texture layout handle, and the section index.

In your example you need an extra argument because the TextureLayoutHandle no longer stores the Handle<Image>

pub fn spawn(
+  image: &Handle<Image>,
    texture: &Handle<TextureAtlasLayout>,
    builder: &mut ChildBuilder,
    color: Color,
) {
    builder.spawn((
        SpriteSheetBundle {
            texture_atlas: TextureAtlas {
                layout: texture.clone(),
                index: 1
           },
            sprite: Sprite {
                color,
                ..Default::default()
            },
+

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@miketwenty1
Comment options

Answer selected by miketwenty1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants