s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejams
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
Get s&box
Sign in with Steam
Api
Components
Button
chevron_left Components
class
Button

Constructors

functionsButton

Properties

data_objectAnimationCurvedata_objectAnimationTimedata_objectAutoResetdata_objectIsAnimatingdata_objectIsOndata_objectModedata_objectMovedata_objectMoveDeltadata_objectMoveTargetdata_objectOffSounddata_objectOnPresseddata_objectOnReleaseddata_objectOnSounddata_objectOnTurnedOffdata_objectOnTurnedOndata_objectResetTimedata_objectTooltipDescriptiondata_objectTooltipDescriptionOffdata_objectTooltipIcondata_objectTooltipIconOffdata_objectTooltipTitledata_objectTooltipTitleOff

Methods

functionsTogglefunctionsTurnOfffunctionsTurnOn
Button
class Sandbox.Mapping .account_tree extends Component
sealedSandbox.Engine

build Constructors 1

Button ()

data_object Properties 22

AnimationCurve
Curve
Animation curve to use, X is the time between 0-1 and Y is how much the button is pressed from 0-1.
AnimationTime
float
How long in seconds should it take to animate this button.
AutoReset
bool
IsAnimating
bool
True if the button is currently animating
IsOn
bool
True if the button is currently on
Mode
ButtonMode
Move
bool
MoveDelta
Vector3
MoveTarget
GameObject
OffSound
SoundEvent
Sound to play when the button is released.
OnPressed
Doo
Called when the button is pressed. Receives the GameObject that pressed it.
OnReleased
Doo
Called when the button is released. Receives the GameObject that released it.
OnSound
SoundEvent
Sound to play when the button is pressed.
OnTurnedOff
Doo
Called when the button turns off.
OnTurnedOn
Doo
Called when the button turns on. Receives the GameObject that activated it.
ResetTime
float
TooltipDescription
string
TooltipDescriptionOff
string
TooltipIcon
string
TooltipIconOff
string
TooltipTitle
string
TooltipTitleOff
string

functions Methods 3

Toggle (presser)
Toggles the button between on and off states.
TurnOff ()
Turns the button off. Does nothing if already off or animating.
TurnOn (presser)
Turns the button on. Does nothing if already on or animating.

Inheritance

Component
Button
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter