Hi guys,
I'm writing an in-game Lua scripting system for my game and trying to implement syntax highlighting. Right now I'm listening for the UIInput's onChange, taking the UIInput.value, and inserting the formatted text into the UIInput.label.text. That works great and keeps the text formatted without tampering with the UIInput's actual value, which is read and saved to a .lua file.
Unfortunately this clears the formatting any time I click in or out of the UIInput. Ok, so I add UICamera.onSelect and process the text again each time the Input is selected or deselected. That part works great when deselected the Input, but not when selecting.
I can't, for the life of me, get the text to consistently stay color formatted. Am I going the wrong direction by taking UIInput.value, processing it, and assigning that text to its UILabel? What would be the best method of getting this done cleanly?
Thanks!