Skip to content

Bevy's own Text2d in a Canvas3D, TextureAtlasBuilder; parity for 2d/text2d, texture_atlas, rotation - #63

Merged
shinyobjectz merged 1 commit into
mainfrom
text2d-atlas
Nov 9, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
text2d-atlas

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

A inside a is now Bevy's own Text2d (TextBounds, FontSmoothing::None, Text2dShadow, spans, z among sprites). TextureAtlasBuilder packs pictures with Bevy's own builder. 2d/text2d is exact; 2d/texture_atlas and 2d/rotation pass. 155 of 155 ported examples pass. skills/ pins raea-skills f81678f (#9).

…ity for 2d/text2d (exact), 2d/texture_atlas and 2d/rotation

A <Text2d> inside a <Canvas3D> is now Bevy's Text2d (raea-sys-sprite text2d.rs, sent as a Shape2D row with its `text` spec): bevy_text lays it out and rasterises it and bevy_sprite_render orders it with the sprites by z, so TextBounds (`bounds`), FontSmoothing::None (`font_smoothing`), Text2dShadow (`shadow`), LineBreak, its <TextSpan>s, a z under a sprite and a scaled quad's pixelated look are Bevy's. After the Canvas3D it is the page's Text, as before; the page refuses bounds, shadow and "None", which it can't draw. 2d/text2d is exact at frames 10 and 60 (SSIM 1.000000, tile 0); with FontSmoothing::None taken out it fails (tile 40, 5308 px off in that block).

TextureAtlasBuilder (raea/sprite, raea/image): pictures packed by Bevy's own builder in the order added (padding, sampler), a sprite showing the whole atlas or one picture (sources.handle(texture), the row's atlas_pick, which sync_2d no longer resets to a sheet's cell). 2d/texture_atlas lists textures/rpg in load_folder's order and passes at 0.998551; its packed atlases match Bevy's.

2d/rotation: the port took the direction to the ship as -at, so the enemy straight above had x = -0 and copysign turned it the other way; player - enemy (0 - 0 = +0) as Bevy subtracts. Passes at 0.999751, its turning enemies within 8 grey of Bevy's at frames 10 and 60 (the bar alone passed a 10 degree a second error).

All 2D ports and shader/pipeline_constants rerun: 155 ported, 155 passing.

skills/ pins raea-skills f81678f (#9), whose generated sdk.md lists TextureAtlasBuilder.
@shinyobjectz
shinyobjectz merged commit e19e07b into main Nov 9, 2026
4 checks passed
@shinyobjectz
shinyobjectz deleted the text2d-atlas branch November 9, 2026 02:28
shinyobjectz added a commit that referenced this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant