Class TextLayoutResult
Represents the result of a text layout.
public class TextLayoutResult : MinMaxWidthLayoutResult
- Inheritance
-
TextLayoutResult
- Inherited Members
Constructors
TextLayoutResult(int, LayoutArea, IRenderer, IRenderer)
Creates the LayoutResult result of layouting }.
public TextLayoutResult(int status, LayoutArea occupiedArea, IRenderer splitRenderer, IRenderer overflowRenderer)
Parameters
status
intthe status of Layout(LayoutContext)
occupiedArea
LayoutAreathe area occupied by the content
splitRenderer
IRendererthe renderer to draw the split part of the content
overflowRenderer
IRendererthe renderer to draw the overflowed part of the content
Remarks
Creates the LayoutResult result of layouting }. The causeOfNothing will be set as null.
TextLayoutResult(int, LayoutArea, IRenderer, IRenderer, IRenderer)
Creates the LayoutResult result of layouting }.
public TextLayoutResult(int status, LayoutArea occupiedArea, IRenderer splitRenderer, IRenderer overflowRenderer, IRenderer cause)
Parameters
status
intthe status of Layout(LayoutContext)
occupiedArea
LayoutAreathe area occupied by the content
splitRenderer
IRendererthe renderer to draw the split part of the content
overflowRenderer
IRendererthe renderer to draw the overflowed part of the content
cause
IRendererthe first renderer to produce NOTHING
Fields
containsPossibleBreak
protected bool containsPossibleBreak
Field Value
endsWithSplitCharacter
protected bool endsWithSplitCharacter
Field Value
leftMinWidth
protected float leftMinWidth
Field Value
rightMinWidth
protected float rightMinWidth
Field Value
splitForcedByNewline
Indicates whether split was forced by new line symbol in text or not.
protected bool splitForcedByNewline
Field Value
startsWithSplitCharacterWhiteSpace
protected bool startsWithSplitCharacterWhiteSpace
Field Value
wordHasBeenSplit
Indicates whether some word was split during layout.
protected bool wordHasBeenSplit
Field Value
Methods
GetLeftMinWidth()
Gets min width of the leftmost unbreakable part of the TextRenderer#line after layout.
public virtual float GetLeftMinWidth()
Returns
- float
min width of the leftmost unbreakable part of the TextRenderer#line after layout.
Remarks
Gets min width of the leftmost unbreakable part of the TextRenderer#line after layout. This value leftMinWidth includes left-side additional width, i.e. left margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, leftMinWidth also includes right-side additional width.
GetRightMinWidth()
Gets min width of the rightmost unbreakable part of the TextRenderer#line after layout.
public virtual float GetRightMinWidth()
Returns
- float
min width of the leftmost unbreakable part of the TextRenderer#line after layout.
Remarks
Gets min width of the rightmost unbreakable part of the TextRenderer#line after layout. This value includes right-side additional width, i.e. right margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, this value must be -1 and right-side additional width must be included in leftMinWidth.
IsContainsPossibleBreak()
Indicates whether split renderer contains possible break.
public virtual bool IsContainsPossibleBreak()
Returns
- bool
true if there's a possible break within the split renderer.
Remarks
Indicates whether split renderer contains possible break. Possible breaks are either whitespaces or split characters.
- See Also
IsEndsWithSplitCharacter()
Indicates whether TextRenderer#line ends with a splitCharacter.
public virtual bool IsEndsWithSplitCharacter()
Returns
- bool
true if TextRenderer#line ends with a splitCharacter.
- See Also
IsSplitForcedByNewline()
Indicates whether split was forced by new line symbol in rendered text.
public virtual bool IsSplitForcedByNewline()
Returns
- bool
whether split was forced by new line or not.
Remarks
Indicates whether split was forced by new line symbol in rendered text. The value will be set as true if, for example, the rendered text contains '\n' symbol. This value can also be true even if the text was fully placed, but had line break at the end.
IsStartsWithSplitCharacterWhiteSpace()
Indicates whether TextRenderer#line starts with a whitespace.
public virtual bool IsStartsWithSplitCharacterWhiteSpace()
Returns
- bool
true if TextRenderer#line starts with a whitespace.
IsWordHasBeenSplit()
Indicates whether some word in a rendered text was split during layout.
public virtual bool IsWordHasBeenSplit()
Returns
- bool
whether some word was split or not.
Remarks
Indicates whether some word in a rendered text was split during layout. The value will be set as true if, for example, the rendered words width is bigger than the width of layout area.
SetContainsPossibleBreak(bool)
public virtual TextLayoutResult SetContainsPossibleBreak(bool containsPossibleBreak)
Parameters
containsPossibleBreak
boolindicates that split renderer contains possible break.
Returns
- TextLayoutResult
this layout result the setting was applied on.
- See Also
SetEndsWithSplitCharacter(bool)
public virtual TextLayoutResult SetEndsWithSplitCharacter(bool endsWithSplitCharacter)
Parameters
endsWithSplitCharacter
boolindicates if TextRenderer#line ends with a splitCharacter.
Returns
- TextLayoutResult
this layout result the setting was applied on.
- See Also
SetLeftMinWidth(float)
Sets min width of the leftmost unbreakable part of the TextRenderer#line after layout.
public virtual TextLayoutResult SetLeftMinWidth(float leftMinWidth)
Parameters
leftMinWidth
floatmin width of the leftmost unbreakable part of the TextRenderer#line after layout.
Returns
- TextLayoutResult
this layout result the setting was applied on.
Remarks
Sets min width of the leftmost unbreakable part of the TextRenderer#line after layout. This value includes left-side additional width, i.e. left margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, leftMinWidth also includes right-side additional width.
SetRightMinWidth(float)
Sets min width of the rightmost unbreakable part of the TextRenderer#line after layout.
public virtual TextLayoutResult SetRightMinWidth(float rightMinWidth)
Parameters
rightMinWidth
floatmin width of the rightmost unbreakable part of the TextRenderer#line after layout.
Returns
- TextLayoutResult
this layout result the setting was applied on.
Remarks
Sets min width of the rightmost unbreakable part of the TextRenderer#line after layout. This value includes right-side additional width, i.e. right margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, this value must be -1 and right-side additional width must be included in leftMinWidth.
SetSplitForcedByNewline(bool)
public virtual TextLayoutResult SetSplitForcedByNewline(bool isSplitForcedByNewline)
Parameters
isSplitForcedByNewline
boolindicates that split was forced by new line symbol in rendered text.
Returns
- TextLayoutResult
this layout result the setting was applied on.
- See Also
SetStartsWithSplitCharacterWhiteSpace(bool)
public virtual TextLayoutResult SetStartsWithSplitCharacterWhiteSpace(bool startsWithSplitCharacterWhiteSpace)
Parameters
startsWithSplitCharacterWhiteSpace
boolindicates if TextRenderer#line starts with a split character that is also a whitespace.
Returns
- TextLayoutResult
this layout result the setting was applied on.
- See Also
SetWordHasBeenSplit(bool)
Sets wordHasBeenSplit
public virtual TextLayoutResult SetWordHasBeenSplit(bool wordHasBeenSplit)
Parameters
Returns
- TextLayoutResult
this layout result the setting was applied on
- See Also