GUICanvasWML
From Wesnoth
THIS PAGE IS AUTOMATICALLY GENERATED, DO NOT MODIFY DIRECTLY !!!
Contents |
Canvas
A canvas is a blank drawing area on which the user can add various items.
Line
Definition of a line. When drawing a line it doesn't get blended on the surface but replaces the pixels instead. A blitting flag might be added later if needed.
Keys:
| key | type | default | description |
|---|---|---|---|
| x1 | f_unsigned | 0 | The x coordinate of the startpoint. |
| y1 | f_unsigned | 0 | The y coordinate of the startpoint. |
| x2 | f_unsigned | 0 | The x coordinate of the endpoint. |
| y2 | f_unsigned | 0 | The y coordinate of the endpoint. |
| colour | widget | "" | The colour of the line. |
Variables:.
| Variable | type | description |
|---|---|---|
| width | unsigned | The width of the canvas. |
| height | unsigned | The height of the canvas. |
| text | tstring | The text to render on the widget. |
Note when drawing the valid coordinates are:
0 -> width - 1
0 -> height -1
Drawing outside this area will result in unpredicatable results including crashing. (That should be fixed, when encountered.)
Rectangle
Definition of a rectangle. When drawing a rectangle it doesn't get blended on the surface but replaces the pixels instead. A blitting flag might be added later if needed.
Keys:
| key | type | default | description |
|---|---|---|---|
| x | f_unsigned | 0 | The x coordinate of the top left corner. |
| y | f_unsigned | 0 | The y coordinate of the top left corner. |
| w | f_unsigned | 0 | The width of the rectangle. |
| h | f_unsigned | 0 | The height of the rectangle. |
| border_thickness | unsigned | 0 | The thickness of the border if the thickness is zero it's not drawn. |
| border_colour | colour | "" | The colour of the border if empty it's not drawn. |
| fill_colour | colour | "" | The colour of the interior if ommitted it's not drawn. |
Variables: See Line.
Image
Definition of an image.
Keys:
| key | type | default | description |
|---|---|---|---|
| x | f_unsigned | 0 | The x coordinate of the top left corner. |
| y | f_unsigned | 0 | The y coordinate of the top left corner. |
| w | f_unsigned | 0 | The width of the image, if not zero the image will be scaled to the desired width. |
| h | f_unsigned | 0 | The height of the image, if not zero the image will be scaled to the desired height. |
| stretch | bool | false | Border images often need to be either stretched in the width or the height. If that's the case use stretch. It only works if only the heigth or the width is not zero. It will copy the first pixel the the others. |
| vertical_mirror | f_bool | false | Mirror the image over the vertical axis. |
| name | f_string | "" | The name of the image. |
Variables:
| Variable | type | description |
|---|---|---|
| image_width | unsigned | The width of the image, either the requested width or the natrual width of the image. This value can be used to set the x (or y) value of the image. (This means x and y are evaluated after the width and height.) |
| image_height | unsigned | The height of the image, either the requested height or the natrual height of the image. This value can be used to set the y (or x) value of the image. (This means x and y are evaluated after the width and height.) |
Also the general variables are available, see Line.
Text
Definition of text.
Keys:
| key | type | default | description |
|---|---|---|---|
| x | f_unsigned | 0 | The x coordinate of the top left corner. |
| y | f_unsigned | 0 | The y coordinate of the top left corner. |
| w | f_unsigned | 0 | The width of the rectangle. |
| h | f_unsigned | 0 | The height of the rectangle. |
| font_size | unsigned | 0 | The size of the font to draw in. |
| font_style | font_style | "" | The style of the text. |
| colour | colour | "" | The colour of the text. |
| text | tstring | "" | The text to draw (translatable). |
NOTE alignment can be done with the forumulas.
Variables:
| Variable | type | description |
|---|---|---|
| text_width | unsigned | The width of the rendered text. |
| text_height | unsigned | The height of the renedered text. |
Also the general variables are available, see Line.
