s&box docs

public static abstract sealed class Editor.Application

Broader workflow and conceptual references connected to this API.

Methods

Showing 4 methods

public static bool IsKeyDown(Editor.KeyCode code)

Returns whether or not a key is currently being held down.

public static string KeyCodeToString(Editor.KeyCode code)

Converts an editor keycode to a string used by the game Qt::Key -> WindowsVirtualKey -> ButtonCode_t -> string

public static void SetStyles(string style)

public static void Spin()

Will process all of the UI events - allowing the UI to stay responsive during a blocking call.

Properties

Showing 11 properties

public static Vector2 Editor.Application.CursorDelta { get; set; }

The cursor delta between this and previous frame.

public static Vector2 Editor.Application.CursorPosition { get; set; }

Get/Set cursor position.

public static float Editor.Application.DpiScale { get; set; }

public static Editor.EditorSystem Editor.Application.Editor { get; set; }

Get the current editor if any. Will return null if we're not in the editor, or there is no active editor session.

public static Editor.Widget Editor.Application.FocusWidget { get; set; }

The `Editor.Widget` that has the keyboard input focus, or `null`if no widget in this application has the focus.

public static Editor.Widget Editor.Application.HoveredWidget { get; set; }

The Widget that is currently hovered

public static Sandbox.MouseButtons Editor.Application.MouseButtons { get; set; }

Returns the current state of the mouse buttons.

public static Vector2 Editor.Application.MouseWheelDelta { get; set; }

The mouse wheel delta between this and previous frame

public static System.Action`2<Editor.Widget,Editor.MouseEvent> Editor.Application.OnWidgetClicked { get; set; }

Called when any widget is clicked. Can set MouseEvent.Accepted to true to prevent the Widget's OnMouseClick from firing.

public static Vector2 Editor.Application.UnscaledCursorPosition { get; set; }

The cursor position, not scaled for DPI

Metadata

FieldValue
NamespaceEditor
Typeclass
AssemblySandbox.Tools
Doc IDT:Editor.Application

On this page