You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried out the example and noticed that it was easy for the window to end up out of the viewport. So I wanted to make it so that the window was clamped inside a viewport, and to do that I wanted to programmatically move the window. Is there a recommended way to do this?
The text was updated successfully, but these errors were encountered:
Hi @sharpobject, you do have control over the placement of the window programmatically through the 'X' and 'Y' options you pass into the 'BeginWindow' function. Passing NoMove = true with the options will disable movement of the window. More information can be found here.
Unfortunately, Slab does not support constraining the window to the viewport at the moment. I looked into how it can be done quickly, but you may need to dive into the Slab internals to get this to work. I can add an option to constrain the window to the viewport in the next update.
The basic gist of how window movement works in Slab is that it records any delta changes when a window is dragged. This delta is then applied to the requested window position on the next frame. The main logic for how a window position is updated is done in the UpdateTitleBar function in the Window.lua module. I would start there if you decide to jump in and try to look into this.
Hello,
I tried out the example and noticed that it was easy for the window to end up out of the viewport. So I wanted to make it so that the window was clamped inside a viewport, and to do that I wanted to programmatically move the window. Is there a recommended way to do this?
The text was updated successfully, but these errors were encountered: