Difference between revisions of "GUIVariable"
(→Simple types: - add f_color, fix color description) |
m (→Simple types) |
||
Line 40: | Line 40: | ||
|- | |- | ||
|style="vertical-align:top"| <span id="color">color</span> | |style="vertical-align:top"| <span id="color">color</span> | ||
− | | A string which contains the color, this a group of 4 numbers between 0 and 255 separated by commas. The numbers are red component, green component, blue component and alpha. An alpha of 0 is fully transparent, while an alpha of 255 is fully opaque | + | | A string which contains the color, this a group of 4 numbers between 0 and 255 separated by commas. The numbers are red component, green component, blue component and alpha. An alpha of 0 is fully transparent, while an alpha of 255 is fully opaque. |
|- | |- | ||
|style="vertical-align:top"| <span id="f_color">f_color</span> | |style="vertical-align:top"| <span id="f_color">f_color</span> |
Latest revision as of 03:14, 5 November 2024
Variables
In various parts of the GUI there are several variables types in use. This page describes them.
Simple types
The simple types are types which have one value or a short list of options.
Variable | Description |
---|---|
unsigned | Unsigned number (positive whole numbers and zero). |
f_unsigned | Unsigned number or formula returning an unsigned number. |
int | Signed number (whole numbers). |
f_int | Signed number or formula returning an signed number. |
bool | A boolean value accepts the normal values as the rest of the game. |
f_bool | Boolean value or a formula returning a boolean value. |
string | A text. |
tstring | A translatable string. |
f_tstring | Formula returning a translatable string. |
function | A string containing a set of function definition for the formula language. |
color | A string which contains the color, this a group of 4 numbers between 0 and 255 separated by commas. The numbers are red component, green component, blue component and alpha. An alpha of 0 is fully transparent, while an alpha of 255 is fully opaque. |
f_color | A color, or a formula returning a color value. |
font_style | A string which contains the style of the font:
Since SDL has problems combining these styles only one can be picked. Once SDL will allow multiple options, this type will be transformed to a comma separated list. If empty we default to the normal style. Since the render engine is replaced by Pango markup this field will change later on. Note widgets that allow marked up text can use markup to change the font style. |
v_align | Vertical alignment; how an item is aligned vertically in the available space. Possible values:
When nothing is set or an another value as in the list the item is centered. |
h_align | Horizontal alignment; how an item is aligned horizontally in the available space. Possible values:
|
f_h_align | A horizontal alignment or a formula returning a horizontal alignment. |
border | Comma separated list of borders to use. Possible values:
|
scrollbar_mode | How to show the scrollbar of a widget. Possible values:
Use auto when the list can be changed dynamically eg the game list in the lobby. For optimization you can also use auto when you really expect a scrollbar, but don't want it to be shown when not needed eg the language list will need a scrollbar on most screens. |
resize_mode | Determines how an image is resized. Possible values:
|
grow_direction | Determines how an image is resized. Possible values:
|
Section types
For more complex parts, there are sections. Sections contain of several lines of WML and can have sub sections. For example a grid has sub sections which contain various widgets. Here's the list of sections.
Variable | description |
---|---|
section | A generic section. The documentation about the section should describe the section in further detail. |
grid | A grid contains several widgets. (TODO add link to generic grid page.) |