-
Notifications
You must be signed in to change notification settings - Fork 5
2.5 Get current UI controls data
Koala Library features two types of functions to get a UI Control data:
-
The developer can retrieve the data as declared in on init callback.
-
The developer can retrieve the current data of the selected UI Control.
This section will cover the first of the two methods.
NOTE: the functions to retrieve both Current and Default data ARE inline functions, therefore can be used in if statements, while loops etc.
This function returns the UI Control's type. The Type of each UI Control is an ID set when declaring the UI Control itself according to what UI Control has been declared (Sliders, Knobs, Buttons etc.).
UI Control Type IDs are listed under “System constants”, “User Interface Constants” section of Koala's Manual.
This IS an inline function, therefore it can be used directly as argument in KSP constructs such as if, while
etc.
Usage:
if (get_type(<ui_id>) = ...)
{...}
end if
These functions return the current position of the specified UI Control on each axis.
These ARE inline functions, therefore they can be used directly as arguments in KSP constructs such as if, while
etc.
Usage:
if (get_pos_x(<ui_id>) = ...)
{...}
end if
These functions return the current size values of the specified UI Control.
These ARE inline functions, therefore they can be used directly as arguments in KSP constructs such as if, while
etc.
Usage:
if (get_width(<ui_id>) = ...)
{...}
end if
This function returns the current value of the specified UI Control.
This IS an inline function, therefore it can be used directly as argument in KSP constructs such as if, while
etc.
Usage:
if (get_value(<ui_id>) = ...)
{...}
end if
This function returns the UI Control's picture name. This function returns a string, so be sure to load its value inside a string value or array.
This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions enabled to receive a string as input.
Usage:
call display_picture_name(get_picture(<ui_id>))
This function returns the UI Control's current visibility status.
This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions enabled to receive a string as input.
Usage:
if (get_visibility(<ui_id>) = ...)
{...}
end if
This function returns the UI Control's current picture state. Use this on labels with multiple animations.
This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions enabled to receive a string as input.
Usage:
if (get_picture_state(<ui_id>) = ...)
{...}
end if