Page 1 of 1

LuaGuiElement.selected [RW] for textboxes

Posted: Wed Jan 22, 2020 7:47 am
by IWTDU
We can use select(start, end) to change selection or cursor position in text fields, but looks like there is no way to know where cursor is. I am making ingame lua code editor with syntax highlighting (programming combinators), and there is working implementation, but it have to compare previous with current text on on_gui_text_changed event to guess cursor position, and it is not always possible. Anyway, it looks like that it is an not-so-difficult-to-add api feature, and it is useful for sure.