Draggable Window

Scripting with the DraggableWindow class.

The DraggableWindow class is a parent class of all split UI windows. It essentially allows the windows to be draggable. The window must be created with the UI Toolkit and must have a button named 'Dragger' that will begin dragging and it should have an element named 'Root' that contains all content.

Fields & Properties

Name
Description
Type
Access

activeSortingOrder

The sorting order set when the window becomes active.

int

protected

inactiveSortingOrder

The sorting order set when the window becomes inactive.

int

protected

startingPosition

The initial position of the window on screen when it's first opened.

StartingPosition

public

dragger

The dragger button.

Button

protected

root

The root visual element.

VisualElement

protected

startingMousePosition

The starting mouse position.

Vector2

protected

startingWindowPosition

The starting window position.

Vector2

protected

pointerDown

If the pointer button was or is held down on the element and has not been stopped being held.

bool

protected

firstOpen

If this is the first time the window is opening.

bool

protected

Active Window

The active draggable window is the one that was last interacted with. This happens automatically. You can access the active draggable window with DraggableWindow.active.

You can set a draggable window as the active one with the SetAsActive method. Use SetAsInactive to have the opposite effect.

myDraggableWindow.SetAsActive();

To set the next one as active, use SetNextAsActive.

myDraggableWindow.SetNextAsActive();

Last updated