When I move a drag window the rect variables constantly change.
Is there a way to read and record the rect value of a drag window in a variable?
I need to create script for drag window with realtime zoom like OS windows. Thanks.
I don’t understand the question.
If you’re dragging a window and it’s working, you must already be recording its position somewhere.
GUI.DragWindow only works if you store the result of the GUI.Window function (which is a rectangle that changes) and use it to draw the window the next frame.
In other words, if your code looks like this:
windowRect = GUIWindow(someId, windowRect, someFunction, someTitle);
The variable named windowRect stores the location of the popup window (it’s probably declared at the top of the script).
As you can see, the same variable is used to draw the window and store its new position each frame.
The way your question is worded, that should be your answer.
…
The GUI.DragWindow() function only alters the x and y values of the rectangle returned by GUI.Window.
If you want to change the size of the popup window, you have to do it yourself.
You could do this when you click a button, for example.
I guess he wants to have the system with minimizable OS-like windows which could be restored to their non-minimized state, so he wants to record the starting position and size.