Difference between revisions of "FontBase:getAdvanceX"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Available since:''' Gideros 2011.6<br/> | + | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> |
− | === Description === | + | === <translate>Description</translate> === |
<translate><br /> | <translate><br /> | ||
Returns the width of the first [[Special:MyLanguage/size|size]] characters of [[Special:MyLanguage/text|text]]. <br /> | Returns the width of the first [[Special:MyLanguage/size|size]] characters of [[Special:MyLanguage/text|text]]. <br /> | ||
Line 11: | Line 11: | ||
(number) = FontBase:getAdvanceX(text,letterSpacing,size) | (number) = FontBase:getAdvanceX(text,letterSpacing,size) | ||
</source> | </source> | ||
− | === Parameters === | + | === <translate>Parameters</translate> === |
'''text''': (string) <translate></translate> <br/> | '''text''': (string) <translate></translate> <br/> | ||
'''letterSpacing''': (number, default = 0) <translate></translate> <br/> | '''letterSpacing''': (number, default = 0) <translate></translate> <br/> | ||
'''size''': (number, optional) <translate></translate> <br/> | '''size''': (number, optional) <translate></translate> <br/> | ||
− | === Return values === | + | === <translate>Return values</translate> === |
− | '''Returns''' (number) <translate>The width of the first size characters of text.</translate><br/> | + | '''<translate>Returns</translate>''' (number) <translate>The width of the first size characters of text.</translate><br/> |
Revision as of 07:29, 24 August 2018
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(text,letterSpacing,size)
Parameters
text: (string)
letterSpacing: (number, default = 0)
size: (number, optional)
Return values
Returns (number) The width of the first size characters of text.