Repository navigation
how to use TextureAtlas with bsn? #26057
|
this is what I'm trying as of now pub fn scene() -> impl Scene {
let controller_bsn = CharacterController::scene();
let atlas_layout = TextureAtlasLayout::from_grid(UVec2::splat(48), 2, 1, None, None);
bsn! {
controller_bsn
Player
Visibility::Visible
Children [(
AtlasAnimator
FacingDirection
Sprite {
image: "images/player.png",
texture_atlas: TextureAtlas {
layout: atlas_layout,
index: 0,
}
}
)]
}
}cargo check gives the following errors My way of doing things might be flawed(and I'm assuming it is) as i didn't find any solutions. i did find an issue but this method this less errors so I'm assuming it might be more correct. cargo check does give more errors but I assume those errors are unrelated. |
Answered by
Monochrotec
Oct 7, 2026
Replies: 1 comment
|
This seems to compile without any errors pub fn scene() -> impl Scene {
let controller_bsn = CharacterController::scene();
let atlas_layout = TextureAtlasLayout::from_grid(UVec2::splat(48), 2, 1, None, None);
bsn! {
controller_bsn
Player
Visibility::Visible
Children [(
AtlasAnimator
FacingDirection
Sprite {
image: "images/player.png",
texture_atlas: OptionTemplate::Some(TextureAtlasTemplate {
layout: asset_value(atlas_layout),
index: 0
})
}
)]
}
} |
0 replies
Answer selected by
Monochrotec
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems to compile without any errors