FontBase:getAdvanceX

From GiderosMobile
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Available since: Gideros 2011.6
Class: FontBase

Description

Returns the width of the first size characters of text.

(number) = FontBase:getAdvanceX(text,letterSpacing,size)

Note that this value is not equal to the 3rd return value (width) of getBounds().

getBounds() returns a rectangle describing the bounds this string will cover whereas getAdvanceX() returns the distance to where the next string should be drawn.

Parameters

text: (string)
letterSpacing: (number, default = 0)
size: (number, optional)

Return values

Returns (number) the width of the first size characters of text