Difference between revisions of "FontBase:getCharIndexAtOffset"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2018.3.1<br/> === Description === <br /> Returns the the offset within the given text string to which correponds the given X offset in...")
 
Line 6: Line 6:
 
<br />
 
<br />
 
<source lang="lua">
 
<source lang="lua">
(number), = FontBase:getCharIndexAtOffset(textoffsetletterSpacingsize,)
+
(number) = FontBase:getCharIndexAtOffset(text,offset,letterSpacing,size)
 
</source>
 
</source>
'''text:''' (string)  ''''''<br/>
+
'''text''': (string)  ''''''<br/>
'''offset:''' (number)  ''''''<br/>
+
'''offset''': (number)  ''''''<br/>
'''letterSpacing:''' (number, default = 0)  ''''''<br/>
+
'''letterSpacing''': (number, default = 0)  ''''''<br/>
'''size:''' (number, optional)  ''''''<br/>
+
'''size''': (number, optional)  ''''''<br/>
 
'''Returns''' (number) The offset within the text string. The decimal part indicate the relative distance throughout the character itself.<br/>
 
'''Returns''' (number) The offset within the text string. The decimal part indicate the relative distance throughout the character itself.<br/>

Revision as of 11:21, 23 August 2018

Available since: Gideros 2018.3.1

Description


Returns the the offset within the given text string to which correponds the given X offset in the drawn text.

(number) = FontBase:getCharIndexAtOffset(text,offset,letterSpacing,size)

'text: (string) '
'offset: (number) '
'letterSpacing: (number, default = 0) '
'size: (number, optional) '
Returns (number) The offset within the text string. The decimal part indicate the relative distance throughout the character itself.