Categories
Last updated
Was this helpful?
Last updated
Was this helpful?
Categories can be used to organize similar states into one group (such as a button's Pressed and Unpressed states).
A category can contain one or more states. States within a category have special behavior:
If one state in a category explicitly sets a variable (such as X), then all other states in that category will also explicitly set the variable.
Each category can be set individually on an instance of a component or standard element. In other words, if a component has two categories, each category can be assigned to a state within that category independently.
To create a new category:
Select a Screen, Component, or Standard element which should contain the new category
Right-click in the States tab in an empty space
Select the Add Category item
Enter a name for the new category
After the new category is created it appears in the States tab as a folder.
To add states to a category:
Right-click on the desired category
Select Add State
Enter a name for the new state
Once the state has been created it can be selected and variables can be changed to add them to the new state.
Once a category is created, the screen, component, or standard element which contains the category i automatically given a variable for that category type. This variable can be assigned on the element itself or on instances of the element.
For example, consider a component with a category named ExampleCategory with two states: State1 and State2.
This component is given a variable named Example Category State.
This value can be assigned in the default state, making the selected state automatically set by default on the component.
For example, the DefaultComponent can select State1 as its Example Category State.
Doing so results in this value automatically being selected on new instances of the DefaultComponent.
As mentioned above, once a state is created, it adds a variable to the component. This variable behaves like any other variable including being able to be set by other states.
For example, consider a component with the following categories and states:
ColorCategory
Bright
Dark
SizeCategory
Big
Small
These states can be combined in a new category. For example, a category called CombinedCategory can be created which can include states such as BrightBig or DarkSmall which in turn sets category variables.
Normally, when a new state is created, all variables are explicitly unset. The value displayed in the properties window will be the value inherited from the default state.
For example, the following image shows a component with a state called State1 with no variables explicitly assigned. Notice all values are green:
We can see the same behavior on a categorized state. The following image shows the categorized LeftSide state with all inherited values:
As mentioned in the introduction, if a variable is explicitly set on one state in a category, then all other states in that category will that same variable set to its default.
For example, if we set the X variable in the LeftSide state, the X variable in the RightSide state will become explicitly set (black instead of green).
Once the X variable is set on one state in a category, all other states in the same category will automatically have this value set - even new states:
Variables can be removed from states, but this removal must be done at the category level rather than at the individual state. Doing so will remove all variables from all states within a category. To remove a variable in all states in a category:
Select the category itself (not the state)
Click the "X" button next to the variable
Confirm that you would like to remove the variable. Warning: this will remove the variable from all contained states.
This will remove the assignment of the variable from all states in the category.