BSN-spawned Sprite with TextureAtlas from custom-loaded layout renders full texture until a visual field is mutated
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
Research direction
Start from the reproduction: a bsn! Sprite with texture_atlas whose layout is a HandleTemplate::Path to a custom-loaded TextureAtlasLayout (menu.atlas.ron#layout). Trace how the template resolves that handle and when the sprite's atlas is applied, since only a real field change fixes it. Add a test that spawns the scene and checks the rendered crop without any mutation. Done when the atlas region applies on the first frame and set_changed() is no longer needed.
Written by the indexing model from the issue text.
Description
Description:
When spawning a Sprite via bsn! with a TextureAtlas whose layout is provided through HandleTemplate::Path, the sprite renders the entire texture instead of the atlas sub-region specified by index. The correct cropped region only appears after manually assigning a different value to a visual field (e.g., index, flip_x, color).
Waiting for frames to pass, calling set_changed(), or reassigning a field to its current value has no effect.
Note: A custom AssetLoader for TextureAtlasLayout is implemented and used to load the layout from menu.atlas.ron#layout. The layout asset itself loads successfully — after the manual visual mutation, the correct region is displayed.
Reproduction:
fn menu() -> impl Scene {
bsn! {
Sprite {
image: "menu.atlas.ron#texture",
texture_atlas: {
TextureAtlasTemplate {
layout: HandleTemplate::Path("menu.atlas.ron#layout".into()),
index: 0,
}
}
}
}
}
Expected: The sprite renders only the region defined by the TextureAtlasLayout at index 0.
Actual:
- The sprite renders the full texture, as if
texture_atlaswereNone. sprite.set_changed()and assigning the same value do not fix it.- Only a real visual change (different index, flipped boolean, changed color) triggers correct atlas cropping.
- Dominant language
- Rust
- Stars
- 49.8k
- Forks
- 5.1k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 136
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bevyengine/bevy
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26641 ·
Maintainers usually reply within 2 days
-
A-Animation AI-Assisted C-Bug D-Trivial S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26637 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26635 ·
Maintainers usually reply within 2 days
-
Feathers checkbox outline should have flex_shrink: 0Possibly taken @Tatsuya0330 claimed this today. OpenC-Bug S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bevyengine/bevy#26630 ·
Maintainers usually reply within 2 days
Similar issues
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day