bevy
bevy copied to clipboard
Text gizmos
Objective
Add naive support for text gizmos.
Draw a label at a given point using the default font. 2d only, no rich text support, no anchors, no rotation.
Fixes #16490
Solution
I'm not familiar with the gizmos implementation, so my plan is to hack together something limited that just about works, and then hand it over to a rendering SME or someone to push over the line.
Done
- Added a
text_2dmethod to theGizmosSystemParamthat adds text gizmos for rendering to aGizmoTextBufferresource. - In post update,
gizmo_text_systemdoes text layout for each text gizmo queued in theGizmoTextBufferand adds the resulting glyph geometry to theGizmoBuffer.
Todo
- Rendering isn't implemented yet, need to implement some sort of
TextGizmoPipelineinbevy_gizmos_render. - I started off by adding a
text_gizmosfeature-gate, but it overcomplicated things at this stage, so removed it for now. I'll add it back at the end.
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.
Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.