Chat in bottom left corner?

How would I put the chat into the bottom left corner using this command?

game:GetService(“StarterGui”):SetCore(“ChatWindowPosition”, UDim2.new(0,0,0,0))

2 Likes

StarterGui:SetCore(“ChatWindowPosition”, UDim2 windowPosition)

image

I’m asking because the size of the chat gui is in scale, so to put it into the bottom left corner I’d have to change the anchor point somehow or do some other magic. Is it possible to change the anchor point of the chat gui?

1 Like

ChatWindowSize

You can find the chat window size using that. I’m not sure whether this size will be in scale or offset or both, (it might be different on mobile devices and stuff), but you can use the size to find the correct position.

2 Likes
StarterGui:SetCore("ChatWindowPosition", UDim2.new(0,0,0.665,0))

The default chat window size is 0.335 on the Y scale, so this should move it to the correct position.

2 Likes

Sorry to bump this, but my chat is being scaled to 0.285, and so that position won’t work. However, changing the screen sizes (mobile/tablet/pc) the chat size changes, so how can I get it to always be in the same spot across all platforms

Manually change it?

If there’s an in-engine way to do something, you should avoid changing things manually. API leaves less room for unpredictability because the behaviour of the API can change when an update is made. Your code, however, will not bend to the same update.

Put this into perspective: you write code to change the position. That frame there gets renamed. The proper API to change the position will update internally to change the position of the frame with the new name and you don’t change a thing in your code. As for code manually setting the position, 's out.

4 Likes

Unless you dynamically change the scale of the chat window size depending on the platform, scale works in terms of percentage of the screen size. Therefore, you just need to take away 0.285 from 1 and that’s the new Y Scale value you should implement. In your case, instead of 0.665, use 0.715.

2 Likes

Before I post, sorry for Necroposting. I stumbled upon this thread after having the same complication, and a quick search around didn’t give me a answer.

So after a few mins it came to my mind how to do it properly. This is how you get your chat window to the bottom left corner of the screen, should work on all devices.

-- Bottom Left Corner ChatWindow
local ChatWindowSize = StarterGui:GetCore("ChatWindowSize") -- We get our ChatWindows size
StarterGui:SetCore("ChatWindowPosition", UDim2.new(0,0,1-(ChatWindowSize.Y.Scale)),0-(ChatWindowSize.Y.Offset)) -- Very simple, set the scale position Y to 1 minus the scale size Y

The reason that I also included Y.Offset (by pixels), is to secure that if the ChatWindow on any device is sized in both scale and offset, it will be accounted for.

As a bonus, here is how you set the ChatWindow to be in the right bottom corner, and top right corner

-- Top Right Corner ChatWindow
local ChatWindowSize = StarterGui:GetCore("ChatWindowSize")
StarterGui:SetCore("ChatWindowPosition", UDim2.new(1-(ChatWindowSize.X.Scale),0-(ChatWindowSize.X.Offset),0,0))
-- Bottom Right Corner ChatWindow
local ChatWindowSize = StarterGui:GetCore("ChatWindowSize")
StarterGui:SetCore("ChatWindowPosition", UDim2.new(1-(ChatWindowSize.X.Scale),0-(ChatWindowSize.X.Offset),1-(ChatWindowSize.Y.Scale)),0-(ChatWindowSize.Y.Offset))
6 Likes