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.
I haven’t used mobile roblox, so I don’t know how the keyboard UI looks, let alone on different phone OSes. But you might still get away with completely hiding the TextBox.
I hope you know that even without copy and pasting users would still be able to type using their keyboard a link into the URL bar. This doesn’t make anything less safe, quiet literally nothing has changed.
edit; for all this is a reply still getting used to devforum formatting, dunno how to quote xP
I’m still out here waiting for TextButton.borderRadius to be a thing. Would be so much easier than to create custom frames, make them image buttons, worry about border clarity. Too much headache. Thanks for the release. Will be using.
It’s been off and on for me, but usually it would either break copy/pasting or holding backspace wouldn’t work. Now that it does, though, it’s a really nice and much needed improvement to the chat.
Yes, I am aware that you could already type a link. Many scams have used it. However, copying and pasting makes these scams much easier. It does change things. If the link is 20 characters long, manually typing it would require going back and forth repeatedly. Copying and pasting allows that process to become instant. I was just wondering if there really was really anything that could be done about this other than just moderation. Could a game be reported for this? Would this violate the TOS?
I was really just curious.
*To quote, highlight text and press the aoute button.
Very nice!
Do you think we will ever have Text texturing?? It’s pretty irritating to make it a bit transparent to get it the texture view of its plate and using meshes