Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make my gui use the entire screen in roblox studio and gui hotkey?

Asked by 5 years ago

im making a gui in roblox studio but when i try to use it ingame it takes up 2/4 of the screen how do i make it take up the entire screen and also how do i make a gui open when i click a key so basically gui hotkey?

1 answer

Log in to vote
0
Answered by
Psudar 882 Moderation Voter
5 years ago
Edited 5 years ago

Use scaling, don't move the GUI and size it by mouse.

In ROBLOX, the GUI is based off of your screen size. Therefor, in studio the screens are smaller because you usually have windows open (like properties tab and output tab).

If you drag and drop GUI in studio, it's not going to match everyone else's game.

Alright, for scaling, you should think of 1 as 100% and 0 as 0%. For example, if you placed a GUI and give it the X scale of 1, and the Y scale of 1, it would take up 100% of the screen.

Another example: if you gave them the X scale of 0.5, and the Y scale of 0.5, it'd take up half the screen.

Scaling is also relative to whatever it's parent is, for example, setting a frame inside a frame. If the frame only takes up 10% of the screen, and the child frame was set to 1 (100%), it would only take up the entire parent frame (10% of the screen).

It sounds a bit confusing but you'll get it if you mess around with it.

Tldr: Set the anchor point to (0.5, 0.5) Set the position scaling to (0.5, 0.5) Set the size scaling to (1, 1) That should take up the entire screen across any device of any screen size.

```lua GuiOpened = false

inputServ.InputBegan:Connect(function(Input) --UserInputService

if Input.KeyCode == Enum.KeyCode.Tab then

if not GuiOpened then -- if GuiOpened == false (basically what thats saying)

GuiOpened = true

    script.Parent.ClickMe.Active = true --Click me is a button parented with the script

    script.Parent.ClickMe.BackgroundTransparency = 0

    script.Parent.ClickMe.TextTransparency = 0

else --GuiOpened wasn't false, so :

GuiOpened = false

    script.Parent.ClickMe.Active = false

    script.Parent.ClickMe.BackgroundTransparency = 1

    script.Parent.ClickMe.TextTransparency = 1

    end
end

end) ```

There's a bunch of ways to actually enable GUI with a hotkey, but there's a simple method using UserInputService and simple properties of a GUI Button frame.

0
e pls give me the solution i literally just gave u a free script Psudar 882 — 5y
Ad

Answer this question