Custom Dropdown
Intro
Create custom dropdowns which can be used to set properties including color, alignment and text from a fixed selection of custom, defined options. This Layer is primarily intended for use alongside the Control Centre.
UI
Selection - The dropdown UI. The contents of the dropdown can be populated by adding new Rows to the list below.
- Use this button to add more rows to the dropdown's UI.
0: Row - The first index in the array.
- Enabled - When checked, this index will be included in the dropdown.
- Name - Enter the label for the option in the dropdown.
- Value - Connect an Attribute or Layer
- Create a Shape.
- Create 3 Color Shaders.
- Set each of the Color Shader's Color Attributes to red, blue and green.
- Create a Custom Dropdown.
- Create 2 new rows by clicking the twice.
- Set the Name for each row to
Red,Blue,Green. - For each Color Shader, connect colorShader.color→customDropdown.rows.value (for each corresponding row).
- Connect customDropdown.id→shape.fillColor.
Use the dropdown that's been created on the Custom Dropdown's Selection row to change the color for the Shape.
Arrays
The dropdown attribute (called Selection by default) outputs integer values so can be used to drive the Index of an Array.
- Create a Shape.
- Create a Color Array.
- Click the button to add a second index to the Array and set a colour.
- Connect colorArray.id→shape.fillColor.
- Create a Custom Dropdown.
- Create a new row by clicking the .
- Set the Name for each dropdown entry to match the corresponding colour from the Array.
- Connect customDropdown.index→colorArray.arrayIndex (
indexis labelled Selection by default).
Use the dropdown that's been created on the Custom Dropdown's Selection row to change the color for the Shape.