FontBase:getAdvanceX

From GiderosMobile
Revision as of 10:03, 23 August 2018 by Hgy29 (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Returns the width of the first `size` characters of `text`. <br /> Note that this value is not...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2011.6

Description


Returns the width of the first `size` characters of `text`.
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.

(number), = FontBase:getAdvanceX(textletterSpacingsize,)

'text: (string) '
'letterSpacing: (number, default = 0) '
'size: (number, optional) '
Returns (number) The width of the first size characters of text.