I Love Textboxes, You Love Textboxes: We Made Changes to 'Em

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.

1 Like

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.

2 Likes

I’m curious what the use case for this is? Is there a reason you can not use text labels?

1 Like

does this mean your text wont delete when you select it again after clicking off of it?

1 Like

You can still enable the ClearTextOnFocus property if you want that behavior.

2 Likes

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.

2 Likes

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?

1 Like

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?

1 Like

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.

2 Likes

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.

1 Like

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!

1 Like

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?

3 Likes

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.

1 Like

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:
image

Unfortunately, text selection doesn’t respect transparency, so the original text shows up behind the custom text:
image

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)

7 Likes

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.

10 Likes

A post was merged into an existing topic: Positive Feedback For Textboxes Update

2 posts were merged into an existing topic: Positive Feedback For Textboxes Update

Yea, since I’m specifically working on making my game work on mobile, I don’t think that would work entirely :stuck_out_tongue:

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.

1 Like