acreol
(acreol)
March 9, 2021, 2:06am
#1
I want the features that @boatbomber implemented in his TextBox Plus module to be native to Roblox TextBoxes:
Features:
Undo/Redo support.
Ctrl-Z and Ctrl-Y are done automatically, and you can call :Undo()
and :Redo()
on the controller object. Snapshots are taken when you stop typing, or if you haven’t taken one in 3 seconds, or if you’ve added 10+ chars since last snapshot. This works well, without having to snapshot every single changed character.
Ctrl-D to select current word.
Built into a ScrollingFrame that autosizes to fit the text.
You can do Settings.Padded = true so that you can scroll down to bring the last line to the top of the frame.
Up/Down arrows cursor movement.
This only works when .MultiLine
is true and .TextWrapped
is false, because .TextWrapped
doesn’t mark where it created newlines so string.split(Text,"\n")
doesn’t work anymore.
Also TextLabels should have font size relative scaling (for the same reasons basically the rest of Roblox UI supports scaling). Otherwise w/o any extra scripting, either the font will be too small/too big on some devices or if we enable .TextScaled
then the font size will vary depending on the length of the input eg:
UITextSizeConstraint is of no use here.
5 Likes