Automatic Size and Automatic Position?

Hello Developers
I’m making a chat for my game but my main problem is, I don’t know how to auto position the text box by size. I’ll give you an example.

Expected:

Reality:

I’ve tried searching but this is what i found:

Thank you so much for the help!

Automatic size will not work in this situation.
You will need to use programming to scale the element, and elements above it (i.e the chat) based on the text content and count.

I’ve think of that, but if for instance, the “i” When they spam i it it’s nothing but if they spammed “e” Then the other letters are not visible.

iiiiiiiiiii - 11 letters
eeeee - 5 letters

Same length, different lens.

Use a combination of AutomaticSize, checking the width of the containing Frame, and possibly TextLabel.TextFits (roblox.com) to see if the Text has overflown and is being wrapped.

However, after correctly using AutomaticSize you should just be able to access accurate Width and Height for the TextLabel as AutomaticSize will resize the containing UI to fit the Text.

I’m not sure how AutomaticSize will handle wrapping and any embeds additionally to all this though and you may be forced to do it programmatically anyways.

1 Like