TextAlignment
has no effect on text alignment, only controls justification for multi-line texts
#8659
Labels
A-UI
Graphical user interfaces, styles, layouts, and widgets
C-Docs
An addition or correction to our documentation
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
Unlike CSS
text-align
which aligns the text inside a box and justify it, in Bevy the alignment of text is based on the concept of anchors. One can build a similar result to CSStext-align
based on anchors and a parent node, but by default the anchor itself does the alignment.The
TextAlignment
property actually controls the justifying of multi-line text only.It's arguable the name
TextAlignment
is suited, due to confusion with CSS and general meaning of "align" which for UI actually move elements to the left/right, whereas here the text as a whole never moves (some parts of it do, but the bounds are unaffected).To make things more confusing, the documentation talks about changes to bounds, but text alignment has no effect on the text bounds, sine all "alignment" is done within the computed bounds derived from the max line length and number of lines.
Proposed actions
text-align
The text was updated successfully, but these errors were encountered: