Skip to content

2.3 Set UI controls data

Davide Magni edited this page May 30, 2017 · 3 revisions

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.

set_pos

This function allows the developer to set a specific UI Control's position given X and Y coordinates.

set_pos(<ui_id>,<x>,<y>)

shift_ctrl

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>)

set_ctrl_pic

This function allows the developer to set a specific UI Control's picture (if any).

set_ctrl_pic(<ui_id>,<picture>)

set_ctrl_text

This function allows the developer to set a specific UI Control's text (if available).

set_ctrl_text(<ui_id>,<text>)

set_font

This function allows the developer to set a specific UI Control's text font and alignment (if available).

set_font(<ui_id>,<font>,<alignment>)

set_value

This function allows the developer to set a specific UI Control's value (if available).

set_value(<ui_id>,<value>)

set_visibility

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>)

set_automation_data and set_xy_automation_data

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>)

value_to_perc and value_to_dec

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>)

scale_slider_out

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>)

Clone this wiki locally