ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. dxGetTextSize

Function

dxGetTextSize

ClientDrawing (dx)Identical to MTA:SA

Returns the width and height of a block of text, also when wrapped to a given width.

Syntax

float, float dxGetTextSize(string text [, float width = 0, float scaleX = 1, float scaleY, string|font font = "default", bool wordBreak = false, bool colorCoded = false])

Arguments

textstring
The text.
widthfloat, optional = 0
Wrap width.
scaleXfloat, optional = 1
Horizontal scale.
scaleYfloat, optional
Vertical scale.
fontstring|font, optional = "default"
Font.
wordBreakbool, optional = false
true = wrap.
colorCodedbool, optional = false
Skip colour codes.

Returns

Width and height.

Example

local w, h = dxGetTextSize("Długi opis zadania, który się zawija", 200, 1, 1, "default", true)

See also