-
Notifications
You must be signed in to change notification settings - Fork 5
2.3 Set UI controls data
Koala features a wide range of functions that can be used to manage every parameter of UI controls.
In this section, we will see how to set data.
This function allows the developer to set a specific UI Control's position given X and Y coordinates.
set_pos(<ui_id>,<x>,<y>)
This function works similarly to set_pos, but instead of moving the UI Control by giving absolute coordinates, it requires to be fed with offset values. The UI Control's resulting position will be relative to its previous position, plus (or minus) an offset.
shift_ctrl(<ui_id>,<off_x>,<off_y>)
This function allows the developer to set a specific UI Control's picture (if any).
set_ctrl_pic(<ui_id>,<picture>)
This function allows the developer to set a specific UI Control's text (if available).
set_ctrl_text(<ui_id>,<text>)
This function allows the developer to set a specific UI Control's text font and alignment (if available).
set_font(<ui_id>,<font>,<alignment>)
This function allows the developer to set a specific UI Control's value (if available).
set_value(<ui_id>,<value>)
This function allow the developer to show or hide a specific UI Control given its UI ID. must be replaced either with VISIBLE or INVISIBLE.
set_visibility(<ui_id>,<value>)
These functions allow the Developer to set an automation ID for host automation. XY Pad has a separate function because in that case the automation is handled differently. Please refer to KSP Reference Manual for more info about automation in Kontakt.
set_automation_data(<ui_id>,<auto_id>,<auto_name>)
These functions return a percentage/decimal value according to the value of a given UI control. Thus, the output of value_to_perc()
is an integer number which ranges from 0 to 100 and the value of value_to_dec()
is a real number which ranges from 0 to 1. The output value depends on the actual range of the UI control, therefore you can set the UI control to negative values as well.
value_to_perc(<ui_id>)
value_to_dec(<ui_id>)
This functions scales the value of any continuous control, like a slider, in a value within a specific range.
scale_slider_out(<ui_id>, <min>, <max>)