How would I stop players from inputting characters into an editable multi-line text box when the text box is full?

Hello,

I’m currently developing a notepad system where players can input text into a multi-line editable text box. When the page is full I’d like for the player to be unable to input anymore text, instead, once it’s full it creates a new line underneath. How would I stop this from happening?

I have tried checking the length of the text and if it is above a certain amount reverting it back to its previous state, but that does not account for the size of a character.

Any help with this would be useful.

Thank you

Can you provide more context? Maybe provide screenshots of your widgets and any code you have attempted?

Hello,

Sorry for the untimely reply

Here is a video demonstrating what I mean. Basically when the notepad page is full, I would like it to not accept anymore play input (except backspace), however it creates a new line instead and continues to accept player input.

As for code I haven’t attempted much, I’ve only really attempted a character limit by doing this, which does work but, for example, if a player inputs more i’s compared to O’s, there may still be a lot of room left on the page a player can’t use.

I was wondering if there’s any nodes to get the amount of lines the editable text box has, or if there’s a boolean i’m missing to stop text input if it wont fit within the current size of the box. I can use C++ a bit if there’s a way to go about it using that.

Thank you

Not sure if you’ve already seen this, but here is a similar thread with several solutions.

Also, it looks like in your blueprint code you are just changing a text variable, but not actually setting that variable to the textbox object. Use the “SetText” function, from your textbox object to set the text of that textbox. You can see examples of this function in the link above.