Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

name
tooltipres = (string) tooltip string asset [optional]
tooltip = (string) tooltip string [optional]
position = (string) Combination of “left”|”right”|”top”|”bottom” [optional]
x = (number) horizontal offset from position in display units [optional]
y = (number) vertical offset from position in display units [optional]
frame = (string) frame asset to display underneath widget [optional]
frameoffset = (string) frame expansion offset from widget for frame asset using 4 comma separated

...

string

...

name identifier

Interface

addBitmapWidget

Code Block
languagelua
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]

A table of parameters specifying the bitmap widget display with the following table values:
name = (string) name identifier [optional]
tooltipres = (string) tooltip string asset [optional]
tooltip = (string) tooltip string [optional]
position = (string) Combination of “left”|”right”|”top”|”bottom” [optional]
x = (number) horizontal offset from position in display units [optional]
y = (number) vertical offset from position in display units [optional]
frame = (string) frame asset to display underneath widget [optional]
frameoffset = (string) frame expansion offset from widget for frame asset using 4 comma separated numbers [optional]
color = (string) ARGB hex code to indicate tint applied to widget display [optional]
displaymode = (string) ““ [all]|”2D”|”3D” [optional]
displaymodeflag_map = (bool) Specify always displays on floor [optional]
rotation = (number) rotation angle [0-359] [optional]
(Bitmap)
w = (number) width in display units [optional]
h = (number) height in display units [optional]
displaytype = (string) ““ [front]|”underlay”|”floor” [optional]
(Text)
font = (string) font asset to use for display [optional]
text = (string) text to use for display [optional]
minw = (number) minimum width for display [optional]
w = (number) maximum width for display [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
(Token widgets only)

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

Code Block
languagelua
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.

...

Code Block
languagelua
function addTextWidget([font], [text])
function addTextWidget([table])

Adds a textwidget to the container.

...

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.