LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.

On this page
  • Index
  • Functions Index
  • Properties Index
  • Functions
  • OnClick
  • Properties
  • Enabled
  • Interactable
  • NormalColor
  • HighlightedColor
  • PressedColor
  • DisabledColor
  • ColorMultiplier
  • GameObject

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Components

SUIButton

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

OnClick

void OnClick (Closure callback)

Invoke when a user clicks the button and releases it.

Parameter
Type
Description

function OnClickFunction()
--
end

Space.Host.ExecutingObject.UIButton.OnClick(OnClickFunction)

Properties

Enabled

bool Enabled get set

Whether the button component is Enabled.

Space.Host.ExecutingObject.UIButton.Enabled = true
--clicking this object will toggle Enable/Disable an object's Button component

thisGameObject = Space.Host.ExecutingObject
button = Space.Host.GetReference("button").UIButton 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
button.Enabled =  not button.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

Interactable

bool Interactable get set

Enable Interactable if you want this button to accept input.

Space.Host.ExecutingObject.UIButton.Interactable = true
--clicking this object will toggle Interactable status on an object's Button component

thisGameObject = Space.Host.ExecutingObject
button = Space.Host.GetReference("button").UIButton 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
button.Interactable=  not button.Interactable
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

NormalColor

The normal color of the control.

Space.Host.ExecutingObject.UIButton.NormalColor = Color.Red

HighlightedColor

The color of the control when it is highlighted.

Space.Host.ExecutingObject.UIButton.NormalColor = Color.Red

PressedColor

The color of the control when it is pressed.

Space.Host.ExecutingObject.UIButton.PressedColor = Color.Red

DisabledColor

The color of the control when it is disabled.

Space.Host.ExecutingObject.UIButton.PressedColor = Color.Red

ColorMultiplier

float ColorMultiplier get set

This multiplies the tint color for each transition by its value. With this you can create colors greater than 1 to brighten the colors on graphic elements whose base color is less than white.

Space.Host.ExecutingObject.UIButton.ColorMultiplier = Color.Red

GameObject

Property Description

Space.Host.ExecutingObject.UIButton.GameObject = Color.Red
PreviousSTrailRendererNextSUICanvas

Last updated 2 years ago

Was this helpful?

void (Closure callback)

bool get set

bool get set

SColor get set

SColor get set

SColor get set

SColor get set

float get set

SGameObject get

NormalColor get set

HighlightedColor get set

PressedColor get set

DisabledColor get set

GameObject get

SColor
SColor
SColor
SColor
SGameObject
OnClick
Enabled
Interactable
NormalColor
HighlightedColor
PressedColor
DisabledColor
ColorMultiplier
GameObject