Difference between revisions of "FontBase:getCharIndexAtOffset"
From GiderosMobile
|  (----) | |||
| Line 1: | Line 1: | ||
| − | + | '''Available since:''' Gideros 2018.3.1<br/> | |
| − | + | '''Class:''' [[FontBase]]<br/> | |
| − | ''' | + | |
| − | ''' | + | === Description === | 
| − | ===  | + | Returns the the offset within the given text string to which correponds the given X offset in the drawn text. | 
| − | + | ||
| − | Returns the the offset within the given text string to which correponds the given X offset in the drawn text.  | ||
| − | |||
| <source lang="lua"> | <source lang="lua"> | ||
| (number) = FontBase:getCharIndexAtOffset(text,offset,letterSpacing,size) | (number) = FontBase:getCharIndexAtOffset(text,offset,letterSpacing,size) | ||
| </source> | </source> | ||
| − | ===  | + | |
| − | '''text''': (string)  | + | === Parameters === | 
| − | '''offset''': (number)  | + | '''text''': (string) <br/> | 
| − | '''letterSpacing''': (number, default = 0)  | + | '''offset''': (number) <br/> | 
| − | '''size''': (number, optional)  | + | '''letterSpacing''': (number, default = 0) <br/> | 
| − | ===  | + | '''size''': (number, optional) <br/> | 
| − | ''' | + | |
| + | === Return values === | ||
| + | '''Returns''' (number) The offset within the text string. The decimal part indicate the relative distance throughout the character itself.<br/> | ||
| + | |||
| + | ---- | ||
| + | {{Special:PrefixIndex/FontBase:}} | ||
| + | <br/> | ||
| + | |||
| + | {{Special:PrefixIndex/FontBase.TLF}} | ||
| + | <br/> | ||
Revision as of 21:25, 2 December 2019
Available since: Gideros 2018.3.1
Class: FontBase
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)
Parameters
text: (string) 
offset: (number) 
letterSpacing: (number, default = 0) 
size: (number, optional) 
Return values
Returns (number) The offset within the text string. The decimal part indicate the relative distance throughout the character itself.
