widgetcontainer
Widget containers are objects that allow widgets to be attached to them. Widgets are graphical components that can be used to customize the appearance of an interface element. Widget containers act as user interface attachment points that dictate the creation and placement of the widgets.
When creating widgets, some of the APIs support creating widgets by a table with parameters. See the table values available when initializing widgets by using a table parameter. All table values are optional.
Table Key | Table Value Type | Description |
---|---|---|
name | string | Name identifier for widget lookup. |
tooltipres | string | String asset to define tooltip. |
tooltip | string | Tooltip text (if string asset not defined). |
position | string | Valid values contain combination of “left”|”right” and/or ”top”|”bottom”. This defines the initial anchor position relative to the widget size. |
x | number | Horizontal offset from initial position in display units |
y | number | Vertical offset from initial position in display units |
frame | string | Frame asset to display underneath widget |
frameoffset | string | Frame expansion offset for how far to offset defined frame from widget size using 4 comma separated numbers (top, left, right, bottom). |
color | string | ARGB hex code to indicate tint color applied to widget display. |
rotation | number | Rotation angle of widget display. [0-359] |
displaymode | string | Valid values are: ““, “2D”, “3D”. Defines which modes that widget is drawn in (all vs. top-down vs. camera). |
Bitmap Widgets Only | ||
w | number | Fixed bitmap widget horizontal size in display units. |
h | number | Fixed bitmap widget vertical size in display units. |
displaytype | string | Valid values are: ““, “underlay”, “floor”. Defines how widget should be drawn relative to token (Over, Under, Always on Floor (3D)). |
Text Widgets Only | ||
font | string | Font asset to display text. |
text | string | Text to display. |
w | number | Maximum text widget horizontal size. |
minw | number | Minimum text widget horizontal size. |
Interface
addBitmapWidget
function addBitmapWidget([bitmap])
function addBitmapWidget([table])
Adds a bitmapwidget to the container.
Parameters
bitmap (string) [optional]
A name of the bitmap resource used in the bitmap widget
table (table) [optional]
See summary of table parameter at the top of this page
Return values
(widget)
The return value is a reference to the created widget.
addTextWidget
function addTextWidget([font], [text])
function addTextWidget([table])
Adds a textwidget to the container.
Parameters
font (string) [optional]
The name of a font resource used for rendering the text in the widget
text (string) [optional]
The text contained in the widget
table (table) [optional]
See summary of table parameter at the top of this page
Return values
(widget)
The return value is a reference to the created widget.