sm.gui.computeTextSize

Calculates the 720 widget size required to display a text

Kind: Function

Environments: Game

Game

sm.gui.computeTextSize( text, font, align, maxWidth, replaceTags )

Open the full Game reference

Availability: Client only

Parameters:

Name Type Description
text string The text to compute.
font string The font to use.
align string The text alignment.
maxWidth (optional) number The maximum desired widget width before wrapping (optional) (Defaults to -1)
replaceTags (optional) boolean Should tags be replaced before calculating? (optional) (Defaults to true)

Returns:

Type Description
{number, number} The calculated width and height.