✓ Accepted answer
ScreenGui acts as a placeholder for resize-able objects within the PlayerGui.
You cannot resize ScreenGui objects directly, as they do not have a Size property. If you click on your SG and view it from the properties window, you will see that such a property does not exist.
Instead, it is required you fill your SG with other elements that are resize-able. Such elements include the following:
- Frame
- ScrollingFrame
- TextBox
- TextButton
- TextLabel
- ImageButton
- ImageLabel
Here is an example of a frame being resized and moved within an SG.
local Players = game:GetService("Players")
local PlayerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local ScreenGui = Instance.new("ScreenGui", PlayerGui)
local Frame = Instance.new("Frame", ScreenGui)
Frame.AnchorPoint = Vector2.new(0.5, 0.5)
Frame.Size = UDim2.new(0, 100, 0, 100)
Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
However, if you wish to manipulate all the elements within a ScreenGui at once, this is possible using ROBLOX's fairly new UI constraint objects. If you wish to learn more about these, take a look at this.
Hope this answered your question.
6 comments
AbsoluteSize is read only, it's basically the stored version of the size of it. You edit it from the Size property. Gui.Size = CameraSize
I tried. But ScreenGui has no Size.
"Size is not a valid member of ScreenGui."
It's the frame or elements within the ScreenGui that have sizes... You have to adjust those.
I'm not really understand. Can you say that again?
The ScreenGui is a mere placeholder for the elements that are to be resized to your liking. Frames, ImageLabels, TextLabels, TextButtons can all be resized.