Hi all,
I am playing around with text editing in Corona and I decided I would like to program a custom cursor. I am able to display and format text fine with display.newText. I am having problems when it comes to repositioning the cursor after inserting new text. When repositioning the cursor, I figured I could just create a text object with one character in it ( I am using a monospaced text, so which one doesn’t matter ) and adding that width to the cursor’s current x coordinate. When I do this, however, I get a “drifting” effect where the cursor ends up farther down the string of text than I intended. It seems like the .width property of a text object returns more than the actual width of the characters contained in it. With this intuition, I just decided I would subtract some value from the width and use that value. The trouble is, I cannot pin down exactly which value to use in order to escape this drifting effect. Is there some minute detail in the .width property that I can use to fix this problem, or is there something else I can do?
Thanks