![]() |
Gorgon Game Engine
|
The user interface in Gorgon Library is based on the components system and is highly customizable.
ComponentStack manages these components within a widget. There are different component types: containers (see ContainerTemplate), placeholders (see PlaceholderTemplate), graphics (see GraphicsTemplate), and textholder (see TextholderTemplate). All subcomponents should be created from the main Template.
Each component has an index and containers have the index of the components that resides in them. There can be multiple components with the same index. ComponentCondition system is used to decide which components will exist at a given time.
It is possible to control the transition of the widget from state to state by giving a specific component for the transition. This is generally used to animate state changes. It is also possible to use transition value channel to have value based animations. These animations can be reversed, even at the middle. In fact, even for regular bitmap animations, this is recommended as it can time the animation perfectly, allow it to be reversed at the middle of the transition (imagine mouse over).
Components can be modified by ValueModification system. There are 4 widget controlled value channels and a fifth controlled by the transition. Values are expected to be in range from 0 to 1. But this can be changed by modifying value ranges. The aspect of the component that the value affects can also be controlled. Channels can be reordered to fit into the necessary order. Value changes can also be asked to be applied smoothly. But this is controlled through the widget.
Component data can be obtained by DataEffect. Data can currently be a text or an image. There are various data effects that can be used by graphics and textholder templates. There are also conditions that trigger if a data channel has any data in it.
Components can be repeated. The repeats are controlled by the widget. Containers are supported to be repeating structures, however, if it has subcomponents they should also set to repeat with the same repeat mode. This will not duplicate subcomponents into the container but rather uses the parent component's information in the subcomponents. Each repeat can have a different set value and condition. There are different repeating systems (such as minor and major) and each of these can be adjusted separately.
Components can have tags to be accessed from the widgets. Some widgets needs specific tags to exist in the template to work.
Components are placed according to a series of complicated but intuitive rules. For details of this system see Component placement.