Minimizing a GUI Issue

Hi there, this is my first time doing anything like this and I’m very new to scripting and building a GUI. In fact, this is my first time building a GUI.

I am having an issue with minimizing and reopening the GUI.

I want to make it so when I minimize the GUI, a small box pops up in the exact spot where I clicked minimize. And when I want to reopen it the GUI pops back up in the exact spot the I clicked open.

I have tried doing a few things and will show such below with Video.

I tried making it so when I clicked the text button that minimizes the GUI it changes Main.Visible = true to Main.Visible = false and a smaller text label that holds a text botton becomes visible. But when I move the smaller text label around and then reopen it, the GUI goes back to where it was when I last closed it. As seen below

This is the code I had to make it show and unshow

    Main.Visible = false
	Open.Visible = true
end)

Xout_2.MouseButton1Click:Connect(function()
    Main.Visible = true
	Open.Visible = false
end)

Then I tried to make Main (the Main Frame of the GUI) the parent of Open ( the parent for the text button that minimizes the GUI) and make Main not Visible while having Open Visible. But that failed to make Open actually Visible.

So if y’all could be of any help and let me know what I need to do to fix this issue that would be great.

Thanks!

Just as a formatting note:

You can use three backticks before and after your code ( ` ) or the button that looks like </> to format your code!

1 Like

The position on screen is saved in format scale,ofset and you need to save the offset every time, you click the button. Then you set position of the other component. Sry, i havent time for giving you script example.

Instead of making Main.Visible equal to false, you could set all its childrens visibility to false except for the open button.

2 Likes

Alright so I did this and It did what I want. But now when I go into the game the GUI has shifted a little bit from how it is in Studio. Here look

In-Studio:

https://gyazo.com/34eb279bbe885f1aad4d3f255e6a19ec

In-Game:

https://gyazo.com/58b13dc1be22ce27a2d4c46bc92d46b3

Any idea how to fix this? or any ideas on it?

This might be because you are using scale instead of offset. I recommend using using offset as your GUI is not that big. If you do not know what scale and offset are, this is a really good topic explaining them:

1 Like

Yep that was the issue.

Thanks so much for all the help.

1 Like