Style.measureText

Measure space given text will use.

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

Parameters

availableSpace Rectangle

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: Rectangle

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