FontBase:getCharIndexAtOffset

From GiderosMobile
Revision as of 01:01, 5 January 2020 by MoKaLux (talk | contribs)

Available since: Gideros 2018.3.1
Class: FontBase

Description

Returns the offset within the given text string to which corresponds 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.