Skip to main content
Version: Next

User Interface - Functions

Introduction

ƒ(x) provides possibility to set dynamically the value of a property using a function.

Screen and Visual Component properties can be used directly in the function.

The result of the function will be assigned to the property to be computed. function_example

Functions are continuously executed when a value used in the computation is changed (e.g. the size of a Visual Component).

Create / Update / Delete

Functions can be created in the properties panel using f(x) button (highlight 1 in screenshot below).

In some cases, f(x) button is in a dropdown menu (highlight 2 in screenshot below).

function_button

Once a function is set on a property, f(x) button becomes darker. To edit the function, click on it. edit_function

To delete the function, click on the red delete button:

delete_function

Exercise 3 - First function

The goal of this exercise is to use a function to dynamically position the button 20 pixels below the title.

  1. Open Screen “Home screen”.
  2. Select the Button “New note button”.
  3. Set its property “Y” to be always 20px below the Label “Title” using a Function:

3.1. Select f(x) for this property:

exercise_3_create_func

3.2. Define the function as below:

function_example