Hi everyone!
I’m trying to develop a quiz game with the classic fill th gaps method.
I’ve a database with some questions with the gaps represented as a “_____” pattern, and I want to create a input field on top of it.
The problem is that since the position of the pattern is not fixed, I have lo locate it.
Since the line height is fixed, was easy to locate the y coordinate, but not the x one (of the first ‘_’ char). I tried several ways, but with no success.
-
I tried to get chars width to generate a left offset with:
textObj.cachedTextGenerator.characters [charPosition].charWidth -
I tried to locate the char with
textObj.cachedTextGenerator.characters [charPosition].cursorPos.x -
I tried to get a monospace font, but it messed all
Has anyone done something similar?
Thank you very much!!
EXAMPLE:
2 + _ = 5
Here I want to locate the x position of the ‘_’ char to create an input field on top.