It has been fixed. I think it was just due to it being enabled in Studio before the main game.
It’s here. It’s finally here. Hell yes.
Ability to color portions of text within the same TextLabel/Textbox when?
ClearTextOnFocus
being set to true will prevent text selection from working in all cases except for Ctrl+A. Is this intentional?
Can we get a property to change selection color?
Hey there! Awesome to see this new feature. As I am creating application centers for groups I was wondering if there is a way to disable the copy/pasting.
You can’t directly, (unless there is a feature), but you can check if there were more than one character added at a time. Just bind the text property to a changed event and check the new text with the old text and if the difference is more than 1 character set the old text.
I’m curious what the use case for this is? Is there a reason you can not use text labels?
does this mean your text wont delete when you select it again after clicking off of it?
You can still enable the ClearTextOnFocus property if you want that behavior.
Well generally from my understanding, his application center needs user input from text boxes and he doesn’t want copy and pasting. Text labels would not work in this situation.
I’m just wondering why copying and pasting is hazardous to his use case. If the user types the data, why is it bad it they can copy it?
These features are useful but how would anyone outside the Forum know that they have been added?
Not only that but Young users probably wouldn’t know these shortcuts, how does Roblox propose to address these situations?
Well, an example would be exams, you don’t get to take your answers in with you, you have to write then in the exam. It could be argued that the same should go for applications, you put effort into it, and you don’t just have all the answers to fill the application in 1 minute. Not to mention that copy/pasting enabled could be used to plagiarise work.
First off, even before this update, anyone could just type them in a notepad and then paste them in. They would then be able to copy from that text editor and still have the answers.
Secondly, you could judge the time it takes for them to answer AND how many characters they type per second (if they paste it in, the characters per second would spike.
oh my god… thank you.
As said above access to the copy and past API and ability to color parts of textlabels etc would be awesome!
This man is ahead of his time.
Seriously though, thank you for these improvements! Could we perhaps get finer control over textwrapping and scaling for textlabels/textboxes next?
Couldn’t you always copy/paste in TextBox’s? I’ve always copy and pasted text into the Text property of a TextBox without any problems, unless I’m missing something here?
You weren’t able to select stuff in text boxes before this feature was introduced. Since you couldn’t select stuff, you weren’t able to copy stuff from text boxes, either.
One small thing I don’t like about this update is the lack of control over the selection styling. I have a custom font rendering system in my game which generates text from a spritesheet and overlays it on top of TextLabels and TextBoxes, and hides the regular text by setting TextTransparency to 1.
Normally it looks like this:
Unfortunately, text selection doesn’t respect transparency, so the original text shows up behind the custom text:
If there was more control over how selections look visually, this would be a perfect update!
(inevitable question faq: yes, it supports unicode and falls back to a regular font for unsupported characters, no, regular roblox fonts don’t fit in well enough with the game theme :p)
What about just positioning the real textbox off-screen? I’ve done a fake textbox before (video), and I think I even set Visible to false for the TextBox itself. To be fair, I also had to use multiple TextLabels to support switching the color mid-way through the text.
EDIT: I didn’t use a custom font in my project, I’m just rendering multiple TextLabels with different colors. Rendering a custom font instead is just another use case.
If you do want to support selection and copy/paste, you can just sync your fake and the real (hidden) textbox, read CursorPosition/SelectionStart and even set them by detecting mouse click/drag. Could even add (ctrl+)shift+arrow selection, ctrl+del word deletion, …
EDIT: I realize I haven’t actually mentioned how my system technically works, so an overview:
Extra info
- Clicking the commandline calls
:CaptureFocus()
on the real hidden TextBox - I listen to .Changed for Text to see when the user types (or even pastes!) something
- Afterwards I actually set
.Text
to an empty string, to properly detect later what’s typed/pasted - The “real” input is stored in an internal string, which I then render however I want
- I actually have a custom cursor, which also gets rendered in the right position (^ same routine)
This was back in the day when there was no CursorPosition, even though TextBoxes had a cursor the user could move (by clicking or left/right arrow) - Use
UserInputService.InputBegan
(if TextBox is focused) to listen for special keybinds- Backspace, left/right arrows for cursor, up/down arrows and LeftAlt for intellisense stuff
-
no idea why I didn’t listen for TextBox.InputBegan, might’ve been buggy for some reason?
Oh I remember: I allowed scrolling through (and dragging) the terminal content, and I also allowed scrolling through suggestions when they were visible. Grouped to prevent overlap.
Before I “paused” the project, I was thinking about how to best do this on mobile. I don’t think I can actually detect “keypresses”, but to be fair, mobile wasn’t really my big focus at that point. I did have the idea of “create a mobile-friendly touch UI” in mind, for quick admin actions. Nothing over the top.
Quite a fun trip down memory lane. I might actually try recreating it with the ability to copy stuff, just for fun. And make it more dev-friendly, as it’s now hard embedded in my project and en-strangled with other code.