Skip to main content

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 change (e.g. the size of a Visual Component).

Create / Update / Delete#

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

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

Once a function 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

Exercice 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:
    • Select f(x) for this property
    • exercise_3_create_func
    • Define the function as below
    • function_example