[UMG] Making highlightable words w/ hitboxes in procedurally generated text.

Hi UE4 community! So I’m working on a glossary like feature, where the user will be able to tap on highlighted words in a description and be able display a popup with some content. Now this wouldn’t be a problem if I was hardcoding the text using UMG, but I’m procedurally generating this text, so i can’t just prepare a hitbox for the word since I don’t know where the word would be. Also from my understanding of UMG, there’s not a feasible way to have multicolored text using one textbox. Ideally, I would need a way to parse text and generate a “button word” whenever I encounter a keyword. I would appreciate any advise to tackle this problem! :smiley:

The colour problem was a significant hurdle in my dialogue system, if you want to change text colour mid sentence, you’ll need multiple Text widgets strung together. If you don’t change the colour mid sentence, then it would be a great deal easier!

As for dynamically sizing content, you can place your text within an invisible button to handle the click events, and have the button size to the content automatically.

Could you apply a material over the top of a section of text to make it appear differently? Just thinking a box that has a particular material on it and it sits in front of the word you are trying to adjust it may work?