Text going out of TextBox

Hello, I’ m making a client and server script runner for my game but I have encountered an issue with the Text in the TextBox.
Image:


As you can see the Text goes out the TextBox and does something very weird.
Can anyone help me make it so the text is scrollable for both X and Y axis?
Thanks for anyone who can.

2 Likes

Just parent the frame to a scrolling frame and in the canvas size put for example (0,4,0,4).

Yeah but will the scrolling frame size change according to how long the text is?

1 Like

Make the TextBox.TextFits property of the textbox to true.

1 Like

Already enabled. And I can’ t disable it

And it still won’t scale properly?

Same thing happens that I showed in the screenshot

Either make the frame bigger or make the TextScaled property true.


This is supposed to be a code editor so I don’ t think this is what I want.

Disable TextScaled then. Is RichText enabled? That’s probably your problem if it is. Try disabling RichText too.


Happens when RichText enabled and disabled this is not what I want, I want it to be scrollable both for X and Y axis.

Isn’t what you want make the text scrollable?

1 Like

Yeah that’ s what I wanna do, but I don’ t know how to achieve it since I tried adding a scrolling frame but I need it to become as large as the text

Use the TextBounds then, i think that will work

Sorry to ask but what’ s that?

image
You can set the scrolling frame canvas size to:

local TextBounds = TextBox.TextBounds
ScrollingFrame.CanvasSize = Udim2.new(0, TextBounds.X, 0, TextBounds.Y)

Should I use a GetPropertyChangedSignal on it so everytime it changes it updates?

Yes, is a option, you can also do it every frame while the TextBox is focused. (If need example notice me)


ScrollingFrame works fine but the normal TextBox doesn’ t
I already tried making ScrollingFrame Size the same as the TextBounds like you suggested but It just made it very small.
Any fixes? And by the way I really appreciate you helping me!

1 Like

Wait, I will make it and send you a file (If I can)