Skip to content

User Controls

User Controls in a plugin take the form of a global variable that can be modified by the end user. They’re all exported from the plugin via ControllableParameters() which returns an array of setting objects as shown below.

export function ControllableParameters(){
return [
{"property":"LightingMode", "label":"Lighting Mode", "type":"combobox", "values":["Canvas","Forced"], "default":"Canvas"},
{"property":"forcedColor", "label":"Forced Color","min":"0","max":"360","type":"color","default":"#009bde"},
{"property":"SettingControl", "label":"Enable Setting Control","type":"boolean","default":"false"},
{"property":"dpi1", "label":"DPI","step":"50", "type":"number","min":"200", "max":"18000","default":"800"}
];
}

These setting objects always have a few base parameters. These are valid for all plugin User Controls.

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
typeThe type of control. Currently, the following options are valid: boolean, number, hue, color, combobox, and textfieldString
defaultThe default value for the control.Varies

The number control allows the user to select the value of a number using a slider.

{"property":"dpi1", "label":"DPI","step":"50", "type":"number","min":"200", "max":"18000","default":"800"},

This control supports the following attributes:

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
type”number”String
defaultThe default value for the control.String, Int
minThe minimum selectable value for the slider. This attribute supports negative values.String, Int
maxThe maximum selectable value for the slider.String, Int
stepThe step value the slider will increment and decrement byString, Int

The boolean control allows the user to select the value of a boolean variable using a toggle control.

{"property":"AngleSnap", "label":"Angle Snapping", "type":"boolean", "default":"0"},

This control supports the following attributes:

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
type”boolean”String
defaultThe default value for the toggle. Set this to 1 to make “on” the default state.String, Int

The hue picker control allows the user to select the hue component of a color with a slider control

This control supports the following attributes:

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
type”hue”String, Int
defaultThe default value for the hue slider.String
minThe minimum selectable hue value. This value must be between 0 and 359.String, Int
maxThe maximum selectable hue value. This value must be between 1 and 360.String, Int

The color control allows the user to select a color using a hue wheel, saturation slider, and luminance slider. The wrench icon will open a more advanced color palette for selection.

{"property":"forcedColor", "label":"Forced Color","min":"0","max":"360","type":"color","default":"#009bde"},

This control supports the following attributes:

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
type”color”String
defaultThe default value for the color picker. This must be specified as a hex value in the form #RRGGBBString
minThe minimum selectable hue value. This value must be between 0 and 359.Int
maxThe maximum selectable hue value. This value must be between 1 and 360.Int

The combo box control allows the user to select from a dropdown menu of preset values.

{"property":"SleepModeTime", "label":"Sleep After x Minutes", "type":"combobox", "values":[5,10,15,30,60], "default":10},

This control supports the following attributes:

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
type”combobox”String
defaultThe default value for the combo box. This value must be in the values arrayString, Int
valuesAn array of values for the dropdown menu. Valid types are strings and integers.[String, Int]

The text field control allows the user to freely enter text with an optional RegEx filter.

{"property":"textBox", "label":"Text Field", "type":"textfield", "default":"3"},

This control supports the following attributes:

ParameterValueType
propertyThe name of the variable you wish to assign to the control.String
labelThe label to display to the user.String
type”textfield”String
defaultThe default value for the textfield.String, Int
filteran optional RegEx filter to limit user inputRegEx String