# 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.

- Kind: class
- Assembly: `Sandbox.Engine`

## Constructors

- [`Instance`](/api/Sandbox.Gizmo.Instance/.ctor)

## Fields

- [`Input`](/api/Sandbox.Gizmo.Instance/Input): Input state. Should be setup before push.

## Properties

- [`ControlMode`](/api/Sandbox.Gizmo.Instance/ControlMode): The current control mode. This is generally implementation specific. We tend to use "mouse" and "firstperson".
- [`Debug`](/api/Sandbox.Gizmo.Instance/Debug): If true, we'll draw some debug information
- [`DebugHitboxes`](/api/Sandbox.Gizmo.Instance/DebugHitboxes): If true we'll enable hitbox debugging
- [`PreviousInput`](/api/Sandbox.Gizmo.Instance/PreviousInput): The previous input state
- [`Selection`](/api/Sandbox.Gizmo.Instance/Selection): This frame's created (or re-used) objects
- [`Settings`](/api/Sandbox.Gizmo.Instance/Settings): 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.
- [`World`](/api/Sandbox.Gizmo.Instance/World): The world the gizmos are drawn into. Created on first use - every scene owns a gizmo instance, but most never draw a gizmo, so don't pay for a native world up front.

## Methods

- [`Clear`](/api/Sandbox.Gizmo.Instance/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.
- [`Dispose`](/api/Sandbox.Gizmo.Instance/Dispose): Destroy this instance, clean up any created resources/scene objects, destroy the world.
- [`GetValue`](/api/Sandbox.Gizmo.Instance/GetValue): Generic storage for whatever you want to do. You're responsible for not spamming into this and cleaning up after yourself.
- [`Push`](/api/Sandbox.Gizmo.Instance/Push): Push this instance as the global Gizmo state. All Gizmo calls during this scope will use this instance.
- [`SetValue`](/api/Sandbox.Gizmo.Instance/SetValue): Generic storage for whatever you want to do. You're responsible for not spamming into this and cleaning up after yourself.
- [`StompCursorPosition`](/api/Sandbox.Gizmo.Instance/StompCursorPosition): 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.
