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 across all Platform tiers.
Use the Properties panel for every Asset and Collection to access binding converters.
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)
- Date Format: format a date according to your need and country specifications
- Custom: [for Platform Premier and Enterprise users only] Use scripting to create complex transformation formulas, like an if ... then ... else ... statement.
- Linear Converter: convert a numeric value located within an input range into a second value located within an output range
- Number Format: convert numeric values, specify the number of decimals, add local currency symbols, etc.
- Text Manipulation: modify text
- URL Shortener: convert a long website URL into a short URL, using the web service provided by TinyURL.
- Color: convert a numeric value located within an input range into a color located within an output range
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.
- Create two Text assets. Leave one blank and type John Smith into the other.
- Open the Properties panel for the blank Text asset and then display the Binding panel.
- 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
- Hover over the binding line with your mouse and click the Converter icon
- Select the Text Manipulation converter category from the list
- Use the Concatenate converter to add the word "Hello" in front of the text John Smith.
Create your own Converter
Platform Premier and Enterprise users can create their own conversion rules using one of two methods:
- Use the built-in Custom Script converter
- Create their own converter using .NET, JavaScript or Web Services
Usage examples
- Parallax effect: See how to create a Parallax effect using the Divide converter in this article.
Limitations
- Value converters will not be deleted from disk after removing them from a binding in Composer edit mode.
Comments
0 comments
Article is closed for comments.