Skip to content

Widget ​

UIScripts: WidgetComponent

From a script ​

ts
import { WidgetComponent } from "mmpx";

const widget = this.entity.TryGetComponent(WidgetComponent);

Full API: WidgetComponent.

Fields ​

FieldTypeDefaultDescription
Top
top
px, "N%" or unset—Pixels or N% from the target's top edge
Bottom
bottom
px, "N%" or unset—Pixels or N% from the target's bottom edge
Left
left
px, "N%" or unset—Pixels or N% from the target's left edge
Right
right
px, "N%" or unset—Pixels or N% from the target's right edge
Horizontal Center
horizontalCenter
px, "N%" or unset—
Vertical Center
verticalCenter
px, "N%" or unset—Offset from the target's centre — positive is up
Align Top
alignTop
booleantrue
Align Bottom
alignBottom
booleantrue
Align Left
alignLeft
booleantrue
Align Right
alignRight
booleantrue
Align Horizontal Center
alignHorizontalCenter
booleantrue
Align Vertical Center
alignVerticalCenter
booleantrue

Settings ​

FieldTypeDefaultDescription
Align Mode
alignMode
"always" | "once" | "on-resize""on-resize"
Target
anchorTarget
Entity—None = the parent

© 2026 PlayAdGentic