s&box docs
API ReferenceSandbox.Mapping

public sealed class Sandbox.Mapping.Button : Sandbox.Component

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 3 methods

public void Toggle(Sandbox.GameObject presser)

Toggles the button between on and off states.

public void TurnOff()

Turns the button off. Does nothing if already off or animating.

public void TurnOn(Sandbox.GameObject presser = null)

Turns the button on. Does nothing if already on or animating.

Parameters

  • presser: Default: null

Properties

Showing 22 properties

public Sandbox.Curve Sandbox.Mapping.Button.AnimationCurve { get; set; }

Animation curve to use, X is the time between 0-1 and Y is how much the button is pressed from 0-1.

public float Sandbox.Mapping.Button.AnimationTime { get; set; }

How long in seconds should it take to animate this button.

public bool Sandbox.Mapping.Button.AutoReset { get; set; }

public bool Sandbox.Mapping.Button.IsAnimating { get; set; }

True if the button is currently animating

public bool Sandbox.Mapping.Button.IsOn { get; set; }

True if the button is currently on

public bool Sandbox.Mapping.Button.Move { get; set; }

public Sandbox.SoundEvent Sandbox.Mapping.Button.OffSound { get; set; }

Sound to play when the button is released.

public Sandbox.Doo Sandbox.Mapping.Button.OnPressed { get; set; }

Called when the button is pressed. Receives the GameObject that pressed it.

public Sandbox.Doo Sandbox.Mapping.Button.OnReleased { get; set; }

Called when the button is released. Receives the GameObject that released it.

public Sandbox.SoundEvent Sandbox.Mapping.Button.OnSound { get; set; }

Sound to play when the button is pressed.

public Sandbox.Doo Sandbox.Mapping.Button.OnTurnedOff { get; set; }

Called when the button turns off.

public Sandbox.Doo Sandbox.Mapping.Button.OnTurnedOn { get; set; }

Called when the button turns on. Receives the GameObject that activated it.

public float Sandbox.Mapping.Button.ResetTime { get; set; }

public string Sandbox.Mapping.Button.TooltipDescription { get; set; }

public string Sandbox.Mapping.Button.TooltipDescriptionOff { get; set; }

public string Sandbox.Mapping.Button.TooltipIcon { get; set; }

public string Sandbox.Mapping.Button.TooltipIconOff { get; set; }

public string Sandbox.Mapping.Button.TooltipTitle { get; set; }

public string Sandbox.Mapping.Button.TooltipTitleOff { get; set; }

Metadata

FieldValue
NamespaceSandbox.Mapping
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Mapping.Button

On this page

Constructorspublic Button()Methodspublic System.Void Toggle(Sandbox.GameObject presser)public System.Void TurnOff()public System.Void TurnOn(Sandbox.GameObject presser = null)Propertiespublic Sandbox.Curve Sandbox.Mapping.Button.AnimationCurve { get; set; }public System.Single Sandbox.Mapping.Button.AnimationTime { get; set; }public System.Boolean Sandbox.Mapping.Button.AutoReset { get; set; }public System.Boolean Sandbox.Mapping.Button.IsAnimating { get; set; }public System.Boolean Sandbox.Mapping.Button.IsOn { get; set; }public Sandbox.Mapping.Button.ButtonMode Sandbox.Mapping.Button.Mode { get; set; }public System.Boolean Sandbox.Mapping.Button.Move { get; set; }public Vector3 Sandbox.Mapping.Button.MoveDelta { get; set; }public Sandbox.GameObject Sandbox.Mapping.Button.MoveTarget { get; set; }public Sandbox.SoundEvent Sandbox.Mapping.Button.OffSound { get; set; }public Sandbox.Doo Sandbox.Mapping.Button.OnPressed { get; set; }public Sandbox.Doo Sandbox.Mapping.Button.OnReleased { get; set; }public Sandbox.SoundEvent Sandbox.Mapping.Button.OnSound { get; set; }public Sandbox.Doo Sandbox.Mapping.Button.OnTurnedOff { get; set; }public Sandbox.Doo Sandbox.Mapping.Button.OnTurnedOn { get; set; }public System.Single Sandbox.Mapping.Button.ResetTime { get; set; }public System.String Sandbox.Mapping.Button.TooltipDescription { get; set; }public System.String Sandbox.Mapping.Button.TooltipDescriptionOff { get; set; }public System.String Sandbox.Mapping.Button.TooltipIcon { get; set; }public System.String Sandbox.Mapping.Button.TooltipIconOff { get; set; }public System.String Sandbox.Mapping.Button.TooltipTitle { get; set; }public System.String Sandbox.Mapping.Button.TooltipTitleOff { get; set; }Metadata