Skip to content

2.4 Get default UI controls data

Davide Magni edited this page Dec 5, 2017 · 5 revisions

Koala Library features two types of functions to get a UI Control data:

  1. The developer can retrieve the data as declared in on init callback.

  2. 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.

get_def_pos_x and get_def_pos_y

These functions return the default position of the specified UI Control on each axis, as declared in on init callback.

These ARE inline functions, therefore they can be used directly as arguments in KSP constructs such as if, while etc.

Usage:

if (get_def_pos_x(<ui_id>) = ...)
	{...}
end if

get_def_width and get_def_height

These functions return the default size values of the specified UI Control, as declared in on init callback.

These ARE inline functions, therefore they can be used directly as arguments in KSP constructs such as if, while etc.

Usage:

if (get_def_width(<ui_id>) = ...)
	{...}
end if

get_def_value

This function returns the default value of the specified UI Control, as declared in on init callback.

This IS an inline function, therefore it can be used directly as argument in KSP constructs such as if, while etc.

Usage:

if (get_def_value(<ui_id>) = ...)
	{...}
end if

get_def_picture

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 such as if, while etc.

Usage:

@picture := get_def_picture(<ui_id>)

get_def_visibility

This function returns the UI Control's default visibility status, as declared in on init callback.

This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions.

Usage:

if (get_def_visibility(<ui_id>) = ...)
	{...}
end if

get_def_text

This function returns the UI Control's default text string, if any, as declared in on init callback.

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 argument.

Usage:

@text := get_def_text(<ui_id>)

get_ctrl_min

This function returns the UI Control's minimum value, as declared in on init callback.

This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions.

Usage:

if (get_ctrl_min(<ui_id>) = ...)
	{...}
end if

get_ctrl_max

This function returns the UI Control's maximum value, as declared in on init callback.

This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions.

Usage:

if (get_ctrl_max(<ui_id>) = ...)
	{...}
end if

get_ctrl_max

This function returns the UI Control's maximum value, as declared in on init callback.

This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions.

Usage:

if (get_ctrl_max(<ui_id>) = ...)
	{...}
end if

get_ctrl_family

This function returns the UI Control's Family, as declared in on init callback.

This IS an inline function, therefore it can be used directly as argument in KSP constructs and functions.

Usage:

if (get_ctrl_family(<ui_id>) = ...)
	{...}
end if
Clone this wiki locally