white-logo

KappaX

burger-icon
search-icon

/

Logic and expressions

In Kappa, logic is the execution of certain actions based on the conditions satisfied. For example, in literal terms, if the rain pours, then take an umbrella (if-then case). This leads to interactivity in your project. 

You can add logic to any layer in the layers panel. Let's take an example, we want a big text "Welcome to Kappa" to float on top of a background video, once that video gets paused. To do so, we select a video layer in the layers panel and then switch from properties to the logic panel.

Logic

Events

Event is anything happening on the artboard.

For example, around the world, anything happening is an event, similarly, in kappa, click, drag, change in position, hiding a layer, etc are events. 

More than 1 event can take place simultaneously.

Triggers

Triggers are defined events in kappa, which when fired, a set of logic block/s may execute then. In the example we're working on, the trigger is 'pause'.

Triggers

A list of triggers is defined corresponding to each element. Types and number of triggers differ from element to element. To write a logic, first, you have to select a trigger on which you want to perform a set of actions. 

Expressions

An expression is a statement to specify rules and actions. For rules, the type of statement is comparative and for actions, it is imperative. For example, 'is it raining' is an expression for the rule, and 'open umbrella' is an expression for action.

You can select the keywords available and make a statement out of them.  Its format looks like the ones in the image below, verb first, then object, and then other specifications. 

Rules expression

Action expressions

Format of expression for rules (comparative) may differ from actions (imperative).

Rules may have 0 or more expressions. Actions may have 1 or more expressions.

Rules and Actions

Rules are a set of expressions that act as IF statements. On its satisfaction, actions execute.

Actions are a set of expressions that act as THEN statements. They execute when conditions (if any) satisfy.

A logic block contains rules and actions. A single block has actions that execute on the satisfaction of the given conditions/rules. All the blocks related to a single layer execute when the selected trigger fires.

In rules, you may have many expressions so you may want the satisfaction of some or all for actions to execute. For this, you can switch between AND & OR options in the rules section.

AND checks for the satisfaction of all the expressions.

OR checks for the satisfaction of at least one of the expressions.

Rules & Actions

Continuing with the example, we've already chosen the trigger "pause" in the video layer, now we'll add a block. Click action to add some. Refer to the video below to see how to do so.

Logic organisation

  1. A single layer may have more than one selected triggers to work under the logic panel.
  2. Each trigger may have multiple logic blocks as per need.
  3. Each block may have multiple expressions in rules and actions.

On this page

Events

Triggers

Expressions

Rules and Actions

Logic organisation