API methods for creating widgets such as buttons, sliders, dropdowns, etc. Use widgets to control parameter values during runtime. Great for experimentation and fine-tuning values. Also usable for building application user-interfaces.
Base class for all GUI elements. Do not instantiate directlyAll GUI elements are Chuck Events, and can be used as such.
UI_Element()
Default constructor for UI_Element.
string text(string text)
Set the text label of this element.
string text()
Get the text label of this element.
[ top ]
Window element. Each instance will create a separate GUI window.Add elements to the window via .add() to display them.
UI_Window()
Default constructor for UI_Window.
void add(UI_Element element)
Adds an element to this window, will be displayed in the order they are added.
[ top ]
Button widget, clicking will trigger the button instance, which itself is a Chuck Event.
UI_Button()
Default constructor for UI_Button.
[ top ]
Base class for float slider widgetDon't instaniate directly, use one of the subclasses e.g. UI_SliderFloat or UI_SliderFloat2CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
UI_SliderFloatBase()
Default constructor for UI_SliderFloatBase.
void power(float power)
Set the power of the slider, e.g. 2.0 for an exponential domain. Defaults to 1.0.
float power()
Get the power of the slider.
void range(float min, float max)
Set the range of the slider.
vec2 range()
Get the range of the slider.
[ top ]
Float slider widget.
UI_SliderFloat()
Default constructor for UI_SliderFloat.
float val()
Get the current value of the slider.
float val(float val)
Set the current value of the slider.
[ top ]
Float2 slider widget. 2 float sliders side by side.
UI_SliderFloat2()
Default constructor for UI_SliderFloat2.
vec2 val()
Get the current value of the slider.
vec2 val(vec2 val)
Set the current value of the slider.
[ top ]
Float3 slider widget. 3 float sliders side by side.
UI_SliderFloat3()
Default constructor for UI_SliderFloat3.
vec3 val()
Get the current value of the slider.
vec3 val(vec3 val)
Set the current value of the slider.
[ top ]
Float4 slider widget. 4 float sliders side by side.
UI_SliderFloat4()
Default constructor for UI_SliderFloat4.
vec4 val()
Get the current value of the slider.
vec4 val(vec4 val)
Set the current value of the slider.
[ top ]
Int slider Base class widgetCTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
UI_SliderIntBase()
Default constructor for UI_SliderIntBase.
void range(int min, int max)
Set the range of the slider.
vec2 range()
Get the range of the slider.
[ top ]
Int slider widgetCTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.
UI_SliderInt()
Default constructor for UI_SliderInt.
int val()
Get the current value of the slider.
int val(int val)
Set the current value of the slider.
[ top ]
Int2 slider widget. 2 int sliders side by side.
UI_SliderInt2()
Default constructor for UI_SliderInt2.
vec2 val()
Get the current value of the slider.
vec2 val(vec2 val)
Set the current value of the slider.
[ top ]
Int3 slider widget. 3 int sliders side by side.
UI_SliderInt3()
Default constructor for UI_SliderInt3.
vec3 val()
Get the current value of the slider.
vec3 val(vec3 val)
Set the current value of the slider.
[ top ]
Int4 slider widget. 4 int sliders side by side.
UI_SliderInt4()
Default constructor for UI_SliderInt4.
vec4 val()
Get the current value of the slider.
vec4 val(vec4 val)
Set the current value of the slider.
[ top ]
Checkbox widget.
UI_Checkbox()
Default constructor for UI_Checkbox.
int val()
Get the current state of the checkbox, 1 for checked, 0 for unchecked.
int val(int val)
Set the current state of the checkbox, 1 for checked, 0 for unchecked.
[ top ]
Color picker widgetTtip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.
UI_Color3()
Default constructor for UI_Color3.
vec3 val()
Get the current value of the color picker.
vec3 val(vec3 color)
Set the current value of the color picker.
[ top ]
Dropdown widgetCreate a dropdown menu with the given list of itemsOn select, the widget will store the selected items *index* and will trigger an event.
UI_Dropdown()
Default constructor for UI_Dropdown.
void options(string[] options)
Set the list of options for the dropdown menu.
int val()
Get the integer index of the curerntly selected dropdown item.
int val(int idx)
Set the integer index of the selected dropdown item.
[ top ]
Text widgetAdd text to the UI windowSupports options such as color, style, and wrapping.
UI_Text()
Default constructor for UI_Text.
vec3 color()
Get the text color.
vec3 color(vec3 color)
Set the text color, defaults to alpha of 1.0 ie fully opaque.
int mode()
Get the text mode. Default is MODE_DEFAULT, meaning no additional formattingMODE_BULLET will display text as a bullet pointMODE_SEPARATOR will display text with a horizontal separator line.
int mode(int mode)
Set the text mode. Default is MODE_DEFAULT, meaning no additional formattingMODE_BULLET will display text as a bullet pointMODE_SEPARATOR will display text with a horizontal separator line.
string text(string text)
Get the text string.
string text()
Set the text string.
int wrap()
Get the text wrapping mode. Default True, meaning text will wrap to end of window.
int wrap(int wrap)
Set the text wrapping mode. Default True, meaning text will wrap to end of windowIf false, text will extend past the window bounds, and the user will need to scroll horizontally to see it.
int MODE_BULLET
Display text as a bullet point.
int MODE_DEFAULT
Default text mode, no additional formatting.
int MODE_SEPARATOR
Display text with a horizontal separator line.
[ top ]