Now, I have a text box in a scroll frame, and I want to calculate the size required for the scroll frame from the number of characters and line breaks in the text box.
Yes, IIRC it’s not optional.
I’d set the X position of the Vector2 to a very high value if how horizontally long the ScrollFrame it is, isn’t a concern Vector2.new(2 ^ 24, 0)
It does work. That’s probably because your TextWrapped is false. If you add a print, and check the size of the textbox from the numbers of characters, you would see it matches.
Onee way to find this out is that you try before asking. I have a plugin wich support horizontal and vertical scrolling, but currently I am on mobile. If I come at my home then I will try to search into the sourceCode how do I made it, because currently I forgot it. I think it was something like this here, but it‘s 99% wrong:
But you atleast why your function dosen‘t work, if not I will try to explain it to you:
My theory is that, you know that you can write a 30 long string, but if you have TextScalled to true it won‘t work, because it scales the text so small that it can fit into the textbox. Your string fits into the textbox, so your code is working, just that because it‘s fitting into you don‘t notice the sizechange, because it dosen‘t change. I have the solution, but I am actually on mobile, sorry. I made a plugin, you can try it out say if it‘s that what you are meaning, because I don‘t understand exactly what you want to achieve:
Yeah I had the same issue as you where gettextsize wouldn’t work for me, but it just gave the length in X, and I found the textbounds worked just fine for me.