Gorgon Game Engine
Conditions

There are many conditions that will effect the visibility/selection of each components.

Using conditions, visuals of widgets can be modified. Conditions are supplied by the widgets depending on their states. A simple example will be mouse over.

Only one component can be present for every index. When there are multiple components for the same index is present, the component to be shown is determined by the active conditions. If there are no conditions present, only components with Always condition will be visible. If there is a condition that matches a component, that particular component will be visible for that index. If there are multiple conditions active for the same index, the last condition applied will take precedence. Not all conditions are supported by all widgets. For the list of conditions see ComponentCondition.

Combining multiple conditions can be done by using containers. Containers could be set to obtain the size of its contents, with no spacing, it will not effect anything visually. Having separate conditions for the container and the component will act as and operation as both conditions should be present for the component to be visible. For or operation, you can have two containers containing the same index with different conditions. Indexes are global, therefore, if one of the containers is visible on the screen, component will be visible. A component cannot be in two separate containers at the same time. Thus the containers should have the same index for exclusivity.

Conditions can transition from one to another. These are also controlled by widgets. For transitions to work, it should be adjusted from the Template. First the transition duration should be set. Then if the transition can be reversed, which is recommended, it should be set as well. Finally, there should be a component with transition from first condition to the second. This can be done by supplying two conditions to Add component functions. With reversed transition and using transition value channel to control the effect, one component can handle both conditions and the transition to both directions.

For instance, for a checkbox, an animation from unchecked to checked can be used for unchecked (Always), checked (State2), Always > State2, State2 > Always by waiting at first frame, waiting at last frame, running the animation forwards and running the animation backwards. All of which can easily be handled by setting value source to Transition, value modification to ModifyAnimation, condition should be set to Always > State2 and finally, the durations for Always > State2 and State2 > Always transitions should be set.