Class TextPainter | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class TextPainter

    Inheritance
    System.Object
    TextPainter
    Namespace: Unity.UIWidgets.painting
    Syntax
    public class TextPainter

    Constructors

    TextPainter(TextSpan, TextAlign, TextDirection, Single, Nullable<Int32>, String)

    Declaration
    public TextPainter(TextSpan text = null, TextAlign textAlign = TextAlign.left, TextDirection textDirection = TextDirection.ltr, float textScaleFactor = 1F, int? maxLines = default(int? ), string ellipsis = "")
    Parameters
    Type Name Description
    TextSpan text
    TextAlign textAlign
    TextDirection textDirection
    System.Single textScaleFactor
    System.Nullable<System.Int32> maxLines
    System.String ellipsis

    Properties

    didExceedMaxLines

    Declaration
    public bool didExceedMaxLines { get; }
    Property Value
    Type Description
    System.Boolean

    ellipsis

    Declaration
    public string ellipsis { get; set; }
    Property Value
    Type Description
    System.String

    height

    Declaration
    public float height { get; }
    Property Value
    Type Description
    System.Single

    maxIntrinsicWidth

    Declaration
    public float maxIntrinsicWidth { get; }
    Property Value
    Type Description
    System.Single

    maxLines

    Declaration
    public int? maxLines { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Int32>

    minIntrinsicWidth

    Declaration
    public float minIntrinsicWidth { get; }
    Property Value
    Type Description
    System.Single

    preferredLineHeight

    Declaration
    public float preferredLineHeight { get; }
    Property Value
    Type Description
    System.Single

    size

    Declaration
    public Size size { get; }
    Property Value
    Type Description
    Size

    text

    Declaration
    public TextSpan text { get; set; }
    Property Value
    Type Description
    TextSpan

    textAlign

    Declaration
    public TextAlign textAlign { get; set; }
    Property Value
    Type Description
    TextAlign

    textDirection

    Declaration
    public TextDirection? textDirection { get; set; }
    Property Value
    Type Description
    System.Nullable<TextDirection>

    textScaleFactor

    Declaration
    public float textScaleFactor { get; set; }
    Property Value
    Type Description
    System.Single

    width

    Declaration
    public float width { get; }
    Property Value
    Type Description
    System.Single

    Methods

    computeDistanceToActualBaseline(TextBaseline)

    Declaration
    public float computeDistanceToActualBaseline(TextBaseline baseline)
    Parameters
    Type Name Description
    TextBaseline baseline
    Returns
    Type Description
    System.Single

    getBoxesForSelection(TextSelection)

    Declaration
    public List<TextBox> getBoxesForSelection(TextSelection selection)
    Parameters
    Type Name Description
    TextSelection selection
    Returns
    Type Description
    System.Collections.Generic.List<TextBox>

    getLineCount()

    Declaration
    public int getLineCount()
    Returns
    Type Description
    System.Int32

    getLineIndex(TextPosition)

    Declaration
    public int getLineIndex(TextPosition position)
    Parameters
    Type Name Description
    TextPosition position
    Returns
    Type Description
    System.Int32

    getLineRange(Int32)

    Declaration
    public Paragraph.LineRange getLineRange(int lineNumber)
    Parameters
    Type Name Description
    System.Int32 lineNumber
    Returns
    Type Description
    Paragraph.LineRange

    getLineRange(TextPosition)

    Declaration
    public Paragraph.LineRange getLineRange(TextPosition textPosition)
    Parameters
    Type Name Description
    TextPosition textPosition
    Returns
    Type Description
    Paragraph.LineRange

    getOffsetForCaret(TextPosition, Rect)

    Declaration
    public Offset getOffsetForCaret(TextPosition position, Rect caretPrototype)
    Parameters
    Type Name Description
    TextPosition position
    Rect caretPrototype
    Returns
    Type Description
    Offset

    getPositionForOffset(Offset)

    Declaration
    public TextPosition getPositionForOffset(Offset offset)
    Parameters
    Type Name Description
    Offset offset
    Returns
    Type Description
    TextPosition

    getPositionVerticalMove(TextPosition, Int32)

    Declaration
    public TextPosition getPositionVerticalMove(TextPosition position, int move)
    Parameters
    Type Name Description
    TextPosition position
    System.Int32 move
    Returns
    Type Description
    TextPosition

    getWordBoundary(TextPosition)

    Declaration
    public TextRange getWordBoundary(TextPosition position)
    Parameters
    Type Name Description
    TextPosition position
    Returns
    Type Description
    TextRange

    getWordLeft(TextPosition)

    Declaration
    public TextPosition getWordLeft(TextPosition position)
    Parameters
    Type Name Description
    TextPosition position
    Returns
    Type Description
    TextPosition

    getWordRight(TextPosition)

    Declaration
    public TextPosition getWordRight(TextPosition position)
    Parameters
    Type Name Description
    TextPosition position
    Returns
    Type Description
    TextPosition

    layout(Single, Single)

    Declaration
    public void layout(float minWidth = 0F, float maxWidth = InfinityF)
    Parameters
    Type Name Description
    System.Single minWidth
    System.Single maxWidth

    paint(Canvas, Offset)

    Declaration
    public void paint(Canvas canvas, Offset offset)
    Parameters
    Type Name Description
    Canvas canvas
    Offset offset
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023