Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
dragengine:modules:dragonscript:xmlguitheme:canvascreator [2018/02/28 14:34] – [ImageBorder] dragonlord | dragengine:modules:dragonscript:xmlguitheme:canvascreator [2018/02/28 16:09] – [Bevel] dragonlord |
---|
Canvas creators are always based directly or indirectly on a type. This type is the //Canvas Creator Prototype// and defines what instance of //CanvasCreator// is used in the scripts. The choice of prototype affects the appearance of the canvas creator and the configuration possibilities. | Canvas creators are always based directly or indirectly on a type. This type is the //Canvas Creator Prototype// and defines what instance of //CanvasCreator// is used in the scripts. The choice of prototype affects the appearance of the canvas creator and the configuration possibilities. |
| |
The following prototypes are provided by default by the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1CanvasCreators.html|CanvasCreators]] script class: | The following prototypes are provided by default by the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1CanvasCreators.html|CanvasCreators]] script class: |
^ Name ^ Script Class ^ Description ^ | ^ Name ^ Script Class ^ Description ^ |
| [[#default|Default]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1DefaultCanvasCreator.html|DefaultCanvasCreator]] | Empty canvas creator | | | [[#default|Default]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1DefaultCanvasCreator.html|DefaultCanvasCreator]] | Empty canvas creator | |
| [[#rectangle|Rectangle]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1RectangleCanvasCreator.html|RectangleCanvasCreator]] | Filled or empty rectangle | | | [[#rectangle|Rectangle]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1RectangleCanvasCreator.html|RectangleCanvasCreator]] | Filled or empty rectangle | |
| [[#bevel|Bevel]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1BevelCanvasCreator.html|BevelCanvasCreator]] | Filled or empty two-color bevelled border | | | [[#bevel|Bevel]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1BevelCanvasCreator.html|BevelCanvasCreator]] | Filled or empty two-color bevelled border | |
| [[#image|Image]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1ImageCanvasCreator.html|ImageCanvasCreator]] | Image stretched across entire canvas | | | [[#image|Image]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1ImageCanvasCreator.html|ImageCanvasCreator]] | Image stretched across entire canvas | |
| [[#imageborder|ImageBorder]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1ImageBorderCanvasCreator.html|ImageBorderCanvasCreator]] | Up to 9 images creating size adapting border | | | [[#imageborder|ImageBorder]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1ImageBorderCanvasCreator.html|ImageBorderCanvasCreator]] | Up to 9 images creating size adapting border | |
| |
You can use custom prototypes by adding them to [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1CanvasCreators.html|CanvasCreators]] instance before loading gui themes. This is useful if you created custom canvas creator subclasses requiring custom parameters. | You can use custom prototypes by adding them to [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1CanvasCreators.html|CanvasCreators]] instance before loading gui themes. This is useful if you created custom canvas creator subclasses requiring custom parameters. |
| |
This example defines a canvas creator based on the //Image// prototype displaying //canvasImage.png// stretched across entire canvas size. | This example defines a canvas creator based on the //Image// prototype displaying //canvasImage.png// stretched across entire canvas size. |
| |
===== Default ===== | ===== Default ===== |
The most basic canvas creator creating no canvas creator at all (empty canvas creator). Creates an instance of the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1DefaultCanvasCreator.html|DefaultCanvasCreator]] script class. This is useful to set an empty canvas creator. As such it has no parameters at all. | The most basic canvas creator creating no canvas creator at all (empty canvas creator). Creates an instance of the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1DefaultCanvasCreator.html|DefaultCanvasCreator]] script class. This is useful to set an empty canvas creator. As such it has no parameters at all. |
| |
| |
===== Rectangle ===== | ===== Rectangle ===== |
Creates a canvas creator drawing a rectangle with optional fill color. Creates an instance of the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1RectangleCanvasCreator.html|RectangleCanvasCreator]] script class. Both the rectangle and fill color are optional. | Creates a canvas creator drawing a rectangle with optional fill color. Creates an instance of the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1RectangleCanvasCreator.html|RectangleCanvasCreator]] script class. Both the rectangle and fill color are optional. |
| |
These parameters can be used: | These parameters can be used: |
| colorFill | [[dragengine:modules:dragonscript:xmlguitheme:parameters#color|Color]] | Color to use to fill the rectangle. Set to null or use a color with alpha value of 0 to not fill the rectangle | | | colorFill | [[dragengine:modules:dragonscript:xmlguitheme:parameters#color|Color]] | Color to use to fill the rectangle. Set to null or use a color with alpha value of 0 to not fill the rectangle | |
| colorLine | [[dragengine:modules:dragonscript:xmlguitheme:parameters#color|Color]] | Color to use to outline the rectangle. Set to null or use a color with alpha value of 0 to not outline the rectangle | | | colorLine | [[dragengine:modules:dragonscript:xmlguitheme:parameters#color|Color]] | Color to use to outline the rectangle. Set to null or use a color with alpha value of 0 to not outline the rectangle | |
| thickness | [[dragengine:modules:dragonscript:xmlguitheme:parameters#floating_point|float]] | Thickness in pixels of the rectangle outline. Default is 1px width. | | | thickness | [[dragengine:modules:dragonscript:xmlguitheme:parameters#floating_point|Floating Point]] | Thickness in pixels of the rectangle outline. Default is 1px width. | |
| |
| |
===== Bevel ===== | ===== Bevel ===== |
Creates a canvas creator drawing a bevelled rectangle with optional fill color. Creates an instance of the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/interfaceDragengine_1_1Gui_1_1CanvasCreators_1_1BevelCanvasCreator.html|BevelCanvasCreator]] script class. Both the rectangle and fill colors are optional. | Creates a canvas creator drawing a bevelled rectangle with optional fill color. Creates an instance of the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CanvasCreators_1_1BevelCanvasCreator.html|BevelCanvasCreator]] script class. Both the rectangle and fill colors are optional. |
| |
These parameters can be used: | These parameters can be used: |