Button
UIScripts: ButtonComponent
From a script
ts
import { ButtonComponent } from "mmpx";
const button = this.entity.TryGetComponent(ButtonComponent);Full API: ButtonComponent.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
Interactableinteractable | boolean | true | |
Transitiontransition | "none" | "color" | "sprite" | "scale" | "scale" | |
Durationduration | number (0 … ∞) (s) | 0.1 |
Colors
| Field | Type | Default | Description |
|---|---|---|---|
NormalnormalColor | colour | #FFFFFF | |
HoverhoverColor | colour | #E0E0E0 | |
PressedpressedColor | colour | #B0B0B0 | |
DisableddisabledColor | colour | #707070 |
Sprites
| Field | Type | Default | Description |
|---|---|---|---|
NormalnormalSprite | texture asset | — | |
HoverhoverSprite | texture asset | — | |
PressedpressedSprite | texture asset | — | |
DisableddisabledSprite | texture asset | — |
Scales
| Field | Type | Default | Description |
|---|---|---|---|
NormalnormalScale | number (0 … ∞) | 1 | |
HoverhoverScale | number (0 … ∞) | 1.05 | |
PressedpressedScale | number (0 … ∞) | 0.95 |