Style.measureText

Measure space given text will use.

  1. Vector2 measureText(Vector2 availableSpace, string text, bool wrap)
    class Style
    const
    Vector2
    measureText
    (,
    string text
    ,
    bool wrap = true
    )
  2. Rectangle measureText(Rectangle availableSpace, string text, bool wrap)

Parameters

availableSpace Vector2

Space available for drawing.

text string

Text to draw.

wrap bool

If true (default), the text will be wrapped to match available space, unless the space is empty.

Return Value

Type: Vector2

If availableSpace is a vector, returns the result as a vector.

If availableSpace is a rectangle, returns a rectangle of the size of the result, offset to the position of the given rectangle.

Meta