Hello! I’ve been searching around the ROBLOX DevForum however I was not capable of finding anything that is supportable to my type of coding, I’ve been trying for quite some time now and I still couldn’t figure out how to decrease the size.
I’ve tried many ways however I’m not capable of it, I’d appreciate if there is anyway to support this type of coding for a chatbar.
NOTE
I want it to keep the exact same coding, I don’t want to use it from the chat modules and etc, because they do not fit in the same code as I’m going for.
LOCAL SCRIPT
local Frame = script.Parent;
local ChatBoxBackground = Frame:WaitForChild("ChatBoxBackground");
local ChatBar = ChatBoxBackground:WaitForChild("MessageChatBox");
local XOffset = ChatBar.Size.X.Offset;
local YOffset = ChatBar.Size.Y.Offset;
ChatBar:GetPropertyChangedSignal("Text"):Connect(function()
local TextFits = ChatBar.TextFits;
local ContentText = ChatBar.ContentText;
if(not TextFits) then
Frame.Size = UDim2.new(0, Frame.Size.X.Offset, 0, ChatBar.TextBounds.Y) + UDim2.new(0, 0, 0, 37);
ChatBoxBackground.Size = UDim2.new(0, ChatBoxBackground.Size.X.Offset, 0, ChatBar.TextBounds.Y) + UDim2.new(0, 0, 0, 31)
ChatBar.Size = UDim2.new(0, XOffset, 0, ChatBar.TextBounds.Y) + UDim2.new(0, 0, 0, YOffset);
end
end);
If there’s any way let me know, this is what I’m trying to achieve.
EXAMPLE
If you have anything that is related towards this and might help me let me know, I want it to stay as the same code as it is : )
UI
I’m quite new to this “textfit” and etc, so let me know of anything that may be a great source to helping!