Difference between revisions of "FontBase:getCharIndexAtOffset"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2018.3.1<br/>
+
'''<translate>Available since</translate>:''' Gideros 2018.3.1<br/>
=== Description ===
+
=== <translate>Description</translate> ===
 
<translate><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 />
Line 8: Line 8:
 
(number) = FontBase:getCharIndexAtOffset(text,offset,letterSpacing,size)
 
(number) = FontBase:getCharIndexAtOffset(text,offset,letterSpacing,size)
 
</source>
 
</source>
=== Parameters ===
+
=== <translate>Parameters</translate> ===
 
'''text''': (string) <translate></translate> <br/>
 
'''text''': (string) <translate></translate> <br/>
 
'''offset''': (number) <translate></translate> <br/>
 
'''offset''': (number) <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 offset within the text string. The decimal part indicate the relative distance throughout the character itself.</translate><br/>
+
'''<translate>Returns</translate>''' (number) <translate>The offset within the text string. The decimal part indicate the relative distance throughout the character itself.</translate><br/>

Revision as of 08:28, 24 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.