Add doc comments explaining the different behaviours of alignment
and Anchor
with text_2d
(#8022)
# Objective Add an explanation of the differences between `alignment` and `Anchor` to the `Text2dBundle` docs. --------- Co-authored-by: Rob Parrett <robparrett@gmail.com> Co-authored-by: François Mockers <mockersf@gmail.com>
This commit is contained in:
parent
ded5d523bd
commit
be217ab037
@ -61,8 +61,15 @@ impl Text2dBounds {
|
||||
#[derive(Bundle, Clone, Debug, Default)]
|
||||
pub struct Text2dBundle {
|
||||
/// Contains the text.
|
||||
///
|
||||
/// With `Text2dBundle` the alignment field of `Text` only affects the internal alignment of a block of text and not its
|
||||
/// relative position which is controlled by the `Anchor` component.
|
||||
/// This means that for a block of text consisting of only one line that doesn't wrap, the `alignment` field will have no effect.
|
||||
pub text: Text,
|
||||
/// How the text is positioned relative to its transform.
|
||||
///
|
||||
/// `text_anchor` does not affect the internal alignment of the block of text, only
|
||||
/// its position.
|
||||
pub text_anchor: Anchor,
|
||||
/// The maximum width and height of the text.
|
||||
pub text_2d_bounds: Text2dBounds,
|
||||
|
Loading…
Reference in New Issue
Block a user