Struct TextAlign
Controls how text is anchored and aligned in relation to its position.
public struct TextAlign
Constructors
TextAlign(float2, TextJustification)
Returns the defaultAlign, but with the anchor and justification set.
public TextAlign(float2 anchor, TextJustification justification)
Parameters
anchorfloat2justificationTextJustification
TextAlign(float2, TextJustification, float2)
public TextAlign(float2 anchor, TextJustification justification = TextJustification.Left, float2 offset = default)
Parameters
anchorfloat2justificationTextJustificationoffsetfloat2
TextAlign(float2, float2)
Returns the defaultAlign, but with the anchor and offset set.
public TextAlign(float2 anchor, float2 offset)
Parameters
Fields
BottomCenter
BottomLeft
BottomRight
MiddleCenter
MiddleLeft
MiddleRight
TopCenter
TopLeft
TopRight
anchor
justification
How to align multiple lines of text.
public TextJustification justification
Field Value
offset
Methods
WithAnchor(float2)
Returns a copy of this alignment with the given anchor.
public TextAlign WithAnchor(float2 anchor)
Parameters
anchorfloat2
Returns
WithJustification(TextJustification)
Returns a copy of this alignment with the given justification.
public TextAlign WithJustification(TextJustification justification)
Parameters
justificationTextJustification
Returns
WithOffset(float2)
Returns a copy of this alignment with the given offset.
public TextAlign WithOffset(float2 offset)
Parameters
offsetfloat2
Returns
Operators
implicit operator TextAlign(TextJustification)
public static implicit operator TextAlign(TextJustification justification)
Parameters
justificationTextJustification