s&box docs

public class Sandbox.Gizmo.Instance

Holds the backend state for a Gizmo scope. This allows us to have multiple different gizmo states (for multiple views, multiple windows, game and editor) and push them as the current active state whenever needed.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

public Instance()

Methods

Showing 6 methods

public void Clear()

Called when the scene changes and we don't want to inherit a bunch of values. We might want to just target some specific values here instead of clearing the log.

public virtual sealed void Dispose()

Destroy this instance, clean up any created resources/scene objects, destroy the world.

public T GetValue(string name)

Generic storage for whatever you want to do. You're responsible for not spamming into this and cleaning up after yourself.

public System.IDisposable Push()

Push this instance as the global Gizmo state. All Gizmo calls during this scope will use this instance.

public void SetValue(string name, T value)

Generic storage for whatever you want to do. You're responsible for not spamming into this and cleaning up after yourself.

public void StompCursorPosition(Vector2 position)

Set all of the state's cursor positions to this value. This stomps previous values which will effectively clear any deltas. This should be used prior to starting a loop.

Properties

Showing 7 properties

public string Sandbox.Gizmo.Instance.ControlMode { get; set; }

The current control mode. This is generally implementation specific. We tend to use "mouse" and "firstperson".

public bool Sandbox.Gizmo.Instance.Debug { get; set; }

If true, we'll draw some debug information

public bool Sandbox.Gizmo.Instance.DebugHitboxes { get; set; }

If true we'll enable hitbox debugging

public Sandbox.Gizmo.Inputs Sandbox.Gizmo.Instance.PreviousInput { get; set; }

The previous input state

public Sandbox.Gizmo.SceneSettings Sandbox.Gizmo.Instance.Settings { get; set; }

Some global settings accessible to the gizmos. Your implementation generally lets your users set up these things to their preference, and the gizmos should try to obey them.

public Sandbox.SceneWorld Sandbox.Gizmo.Instance.World { get; set; }

The SceneWorld this instance is writing to. This world exists only for this instance. You need to add this world to your camera for it to render (!)

Metadata

FieldValue
Namespaceglobal
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Gizmo.Instance

On this page