|
|
(3 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | A control that executes code in response to user interactions.
| + | This page has moved to: https://docs.sine.space/v/scripting/client-scripting/components/suibutton |
− | | + | |
− | =Members=
| + | |
− | | + | |
− | {{ScriptFunction|void|OnClick|(Closure callback);|Invoke when a user clicks the button and releases it.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | function Click()<br>
| + | |
− | button.OnClick(function ()<br>
| + | |
− | Space.Log("Hello Lua!")<br>
| + | |
− | button.end)
| + | |
− | end
| + | |
− | }}
| + | |
− | | + | |
− | =Properties=
| + | |
− | | + | |
− | {{ScriptFunction|bool|Enabled|{get; set;}|Whether the button component is Enabled or not.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.Enabled)<br>
| + | |
− | ''--return true.''
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|bool|Interactable|{get; set;}|Enable Interactable if you want this button to accept input.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.Interactable)<br>
| + | |
− | ''--return true.''
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SColor|NormalColor|{get; set;}|The normal color of the control.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.NormalColor)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SColor|HighlightedColor|{get; set;}|The color of the control when it is highlighted.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.HighlightedColor)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SColor|PressedColor|{get; set;}|The color of the control when it is pressed.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.PressedColor)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SColor|DisabledColor|{get; set;}|The color of the control when it is disabled.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.DisabledColor)
| + | |
− | }}
| + | |
− | | + | |
− | {{ScriptFunction|SColor|DisabledColor|{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.|5=local button=Space.Host.GetReference("Button").UIButton<br>
| + | |
− | ''--add Button to object references.''<br>
| + | |
− | Space.Log(button.ColorMultiplier)<br>
| + | |
− | ''--print 1.''
| + | |
− | }}
| + | |
− | | + | |
− | | + | |
− | {{Scripting Navbox}}
| + | |