The Window System

Important

OSL applications are all run as windows, even scripts, everything is a window.

Each file only has access to a single window and acts as only one window

If you want to do almost anything with the window in osl you will more than likely need to use either the window commands or the newer, window object

Showing the window

window.show()
// Shows the window (allowing the user to move/drag and resize the window by default)

window.hide()
// Hides the window, stopping all user interaction that is handled by origin

If a window is hidden and lacks a "mainloop:" label, it will be closed by origin when the program finishes execution.

Modifying the window

You can modify the parameters of your osl window in origin such as disabling resizing, moving, and changing the dimensions of your window.

Window Position

window.x = x
// set the window's x position

window.y = y
// set the window's y position

Window Size

Closing the window and execution control

Extra

If your window is hidden and you are rendering things, they may leave a trail behind, so when you move the thing you are rendering and need to clear the screen, use this window method.

DragBox

The window dragbox sets the hitbox where the user can drag on your window to move it around. This method takes two arrays of inputs in the same order and meaning as in an loc command.

Create a new window

window.create takes the (name / path / uuid) of an osl file and creates a new window using it. It also takes an object of parameters for the setup of the program.

All endpoints on the window variable

Parents and Children

Parent Variables

In osl, if the parent window is running the same file as the child window, you can access the parent's variables by reference to edit and view them in real time.

Create a new window

File and code data

Window Location

Window Permissions

Accent Colour

You can set the outline of your window using the window_accent variable

Screenshot 2024-07-04 at 18 41 04

Last updated

Was this helpful?