Value Converters

    Description

    You already know how to use bindings to transfer values between properties, trigger parameters and action parameters.

    Now imagine you need to transform the source value before transferring it to the binding target. You can achieve this using a converter. The conversion can be as simple as adding 10 to the input value to something as complex as use of a custom script with conditions.

    The majority of converters are available in all Composer Editions, including the Free Edition. Current converters work with a single input. Future converters will work with multiple inputs to generate a single output, adding even more flexibility.

    Use the Properties panel for every Asset and Collection to access binding converters.

    Converter-2.jpg

    Off-the-shelf Converters

    The following converters ship with IntuiFace. To create your own converter, see this section below.

    • Math & Logic: add, subtract, multiply, divide numeric values or invert booleans (true/false)
    • Linear Converter: convert a numeric value located within an input range into a second value located within an output range
    • Date Format: format a date according to your need and country specifications
    • Number Format: convert numeric values, specify the number of decimals, add local currency symbols, etc.
    • Text Manipulation: modify text
    • Custom Script: [for Composer Enterprise users only] Use scripting to create complex transformation formulas, like an if ... then ... else ... statement.
    • Color: convert a numeric value located within an input range into a color located within an output range

    Converter-3.jpg

    When a Converter Can Be Used

    Converters can be applied to any use of binding. This means a property value can be converted before it is transferred via binding to:

    • a second Property of the same asset or a different one. This type of binding is defined here.
    • a Trigger Parameter. This type of binding is defined here.
    • an Action Parameter. This type of binding is defined here

    Example Using Property-to-Property Binding

    This example illustrates how to use a converter with property-to-property binding. We will place Hello in front of the text John Smith.

    1. Create two Text assets. Leave one blank and type John Smith into the other.
    2. Open the Properties panel for the blank Text asset and then display the Binding panel.


      Convert-step1.jpg
    3. On the right of the Binding panel, select the Text asset containing the John Smith text - the Source Item - this will be the source of the value to be bound. Click on the Text value of the blank text and on the Text value of the Source Text John Smith. This will bind the two text values

      Convert-step2.jpg
    4. Hover over the binding line with your mouse and click the Converter icon

      Convert-step3.jpg
    5. Select the Text Manipulation converter category from the list

      Convert-step4.jpg
    6. Use the Concatenate converter to add the word "Hello" in front of the text John Smith.

    Convert-step5.jpg

    Create your own Converter

    Composer Enterprise users can create their own conversion rules using one of two methods:

    Usage examples

    • Parallax effect: See how to create a Parallax effect using the Divide converter in this article