public sealed class Sandbox.Mapping.Button : Sandbox.Component
Related Guides
Broader workflow and conceptual references connected to this API.
When creating your own Classes/Structs/Assets/ect, you'll sometimes want custom editors that pair with them. For example, a Gradient Editor so you can visually see what the Gradient looks like instead of editing the Gradient as if it were a Struct with a list of Colours.
You can create your own editor tool to help you create your game. Your tool needs to be created in an editor project.
Editor UI is built entirely out of Widgets. Widgets are different from Panels, which are used for in-game UI. Widgets can be various elements or components, such as labels, buttons, text boxes, trees, or images.
You can broadcast and listen to events in your scene using interfaces.
Input is accessed using the… Input class!
Razor Component allow you to define some content to show inside another razor file. This makes it easy to create Panels that are more agile and reusable.
Constructors
Showing 1 constructors
public Button()
No results match this filter.
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
No results match this filter.
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 Sandbox.Mapping.Button.ButtonMode Sandbox.Mapping.Button.Mode { get; set; }
public bool Sandbox.Mapping.Button.Move { get; set; }
public Sandbox.GameObject Sandbox.Mapping.Button.MoveTarget { 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; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Mapping |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Mapping.Button |