Table of Contents

FontBase:getCharIndexAtOffset

Available since version: 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.

Syntax:

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

Parameters:

  • text: (string)
  • offset: (number)
  • letterSpacing: (number, default = 0)
  • size: (number, optional)

Return value:

  • number: The offset within the text string. The decimal part indicate the relative distance throughout the character itself.