Button
Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.
Up and coming
The one clickable. It answers hover and press by itself, holds a selected state, and fires Activated on a click, Enter or Space.
A Button is a Frame that draws its own hover, press and selected looks, so nothing clickable is ever inert. Hover eases in over 0.35 s and out over 0.6 s, a press in over 0.4 s and out over 0.6 s, on the Modify curve, and the cursor is a hand. Text and icons are its children: a text button is a Button holding a TextLabel, an image button one holding an ImageLabel.
Made with Instance.new("Button") or Clone().
local function example(x : Button)
local row = Instance.new("Button")
row.Activated:Connect(function(input : InputObject)
print(input.ClickCount)
end)
endProperties
| Name | Type | Default | Description |
|---|---|---|---|
| Enabled | boolean | False dims it and it stops answering. | |
| HoverLift | number | How far the background lifts toward white on hover; 0.08 by default. | |
| PressLift | number | 0.15 by default. | |
| PressOffset | Vector2 | How far its contents nudge when pressed, in pixels; (0, 1) by default. | |
| Selected | boolean | A held state, such as the open tab or the chosen row, eased like hover. | |
| SelectedColor | Color3 | ||
| Hovered | boolean | read-only | Checked again after every tree change, so a row rebuilt under a still pointer stays hovered. |
| Pressed | boolean | read-only |
Events
| Name | Passes | Description |
|---|---|---|
| Activated | (InputObject) | Fires on a left click released over it, or on Enter or Space while it has focus. |
| DoubleClicked | (InputObject) | |
| HoverChanged | (boolean) |
From Frame 10
From UIObject 19
From ScreenItem 2
From ShotInstance 33
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
