Select one word in a text field

Is there a way to select individual words in a text field? Let’s say that player clicks on a word, I’d like to select that word, color it, know exactly which word was clicked on. Is there an easy way to do it?

I thought of two solutions - I think I could have a lot of text fields, one for each word. However, I think that could be heavy performance-wise. Another thing to try is to get an individual character that was clicked using TextField’s method getCharIndexAtPoint(). Then I could iterate through characters to find the beginning and ending of the word.

But is there any other way to select words?

I am not aware of a better method than the second option you listed. That’s probably what I would end up doing myself.

Yeah, and I also decided on this solution. I know that TextMeshPro in Unity actually has a method that allows to check what word was clicked on. I was just wondering if OpenFL might have something similar, but it seems it doesn’t. Thanks!