LuaGuiElement(text-box)::selection
Posted: Fri Apr 19, 2019 12:24 pm
Currently there is no way to figure out where the text cursor is (when the text-box has changed)
It's nice that you added the parameter select(start, end) and that it's able to set the cursor by using select(index+1,index), but it's still missing a way to read the current position to create a fully-featured ingame text editor (what i'm doing right now)
You could iterate the text and look for changes, but for example when the string is aaabbb and you insert another a, you can't tell at what position the a has been inserted because the change would happen at the transition to the b's
It's nice that you added the parameter select(start, end) and that it's able to set the cursor by using select(index+1,index), but it's still missing a way to read the current position to create a fully-featured ingame text editor (what i'm doing right now)
You could iterate the text and look for changes, but for example when the string is aaabbb and you insert another a, you can't tell at what position the a has been inserted because the change would happen at the transition to the b's