Difference between revisions of "FontBase:getCharIndexAtOffset"

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

Revision as of 14:34, 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)

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.