Widget
UIScripts: WidgetComponent
From a script
ts
import { WidgetComponent } from "mmpx";
const widget = this.entity.TryGetComponent(WidgetComponent);Full API: WidgetComponent.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
Toptop | px, "N%" or unset | — | Pixels or N% from the target's top edge |
Bottombottom | px, "N%" or unset | — | Pixels or N% from the target's bottom edge |
Leftleft | px, "N%" or unset | — | Pixels or N% from the target's left edge |
Rightright | px, "N%" or unset | — | Pixels or N% from the target's right edge |
Horizontal CenterhorizontalCenter | px, "N%" or unset | — | |
Vertical CenterverticalCenter | px, "N%" or unset | — | Offset from the target's centre — positive is up |
Align TopalignTop | boolean | true | |
Align BottomalignBottom | boolean | true | |
Align LeftalignLeft | boolean | true | |
Align RightalignRight | boolean | true | |
Align Horizontal CenteralignHorizontalCenter | boolean | true | |
Align Vertical CenteralignVerticalCenter | boolean | true |
Settings
| Field | Type | Default | Description |
|---|---|---|---|
Align ModealignMode | "always" | "once" | "on-resize" | "on-resize" | |
TargetanchorTarget | Entity | — | None = the parent |