Both sides previous revisionPrevious revision | |
dragengine:modules:dragonscript:xmlguitheme:borderfactory [2020/04/03 10:21] – url move dragonlord | dragengine:modules:dragonscript:xmlguitheme:borderfactory [2024/03/14 16:35] (current) – dragonlord |
---|
Border factories are always based directly or indirectly on a type. This type is the //Border Prototype// and defines what instance of //BorderFactory// is used in the scripts. The choice of prototype affects the appearance of the border and the factory configuration possibilities. | Border factories are always based directly or indirectly on a type. This type is the //Border Prototype// and defines what instance of //BorderFactory// is used in the scripts. The choice of prototype affects the appearance of the border and the factory configuration possibilities. |
| |
The following prototypes are provided by default by the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BorderFactories.html|BorderFactories]] script class: | The following prototypes are provided by default by the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BorderFactories.html,BorderFactories~@# script class: |
^ Name ^ Script Class ^ Description ^ | ^ Name ^ Script Class ^ Description ^ |
| [[#empty|Empty]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EmptyBorderFactory.html|EmptyBorderFactory]] | Empty border factory | | | [[#empty|Empty]] | #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EmptyBorderFactory.html,EmptyBorderFactory~@# | Empty border factory | |
| [[#line|Line]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1LineBorderFactory.html|LineBorderFactory]] | Line border | | | [[#line|Line]] | #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1LineBorderFactory.html,LineBorderFactory~@# | Line border | |
| [[#bevel|Bevel]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BevelBorderFactory.html|BevelBorderFactory]] | Two-color bevelled border | | | [[#bevel|Bevel]] | #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BevelBorderFactory.html,BevelBorderFactory~@# | Two-color bevelled border | |
| [[#etched|Etched]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EtchedBorderFactory.html|EtchedBorderFactory]] | Two-color etched border | | | [[#etched|Etched]] | #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EtchedBorderFactory.html,EtchedBorderFactory~@# | Two-color etched border | |
| [[#canvascreator|CanvasCreator]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1CanvasCreatorBorderFactory.html|CanvasCreatorBorderFactory]] | Border drawn by a canvas creator. Make sure the used canvas creator does not fill the center since it is laid over the widget | | | [[#canvascreator|CanvasCreator]] | #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1CanvasCreatorBorderFactory.html,CanvasCreatorBorderFactory~@# | Border drawn by a canvas creator. Make sure the used canvas creator does not fill the center since it is laid over the widget | |
| |
You can use custom prototypes by adding them to [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BorderFactories.html|BorderFactories]] instance before loading gui themes. This is useful if you created custom border factory subclasses requiring custom parameters. | You can use custom prototypes by adding them to #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BorderFactories.html,BorderFactories~@# instance before loading gui themes. This is useful if you created custom border factory subclasses requiring custom parameters. |
| |
This example defines a border factory based on the //Line// prototype. | This example defines a border factory based on the //Line// prototype. |
| |
===== Empty ===== | ===== Empty ===== |
The most basic border factory drawing no border yet still occupies space. It is used to create empty borders around widgets simulating margins without altering layout managers used. Creates an instance of the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EmptyBorderFactory.html|EmptyBorderFactory]] script class. | The most basic border factory drawing no border yet still occupies space. It is used to create empty borders around widgets simulating margins without altering layout managers used. Creates an instance of the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EmptyBorderFactory.html,EmptyBorderFactory~@# script class. |
| |
These parameters can be used: | These parameters can be used: |
| |
===== Line ===== | ===== Line ===== |
Creates a border factory drawing a line around the widget. Creates an instance of the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1LineBorderFactory.html|LineBorderFactory]] script class. This border adds a size of //thickness// rounded down to the next integer value around the widget. | Creates a border factory drawing a line around the widget. Creates an instance of the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1LineBorderFactory.html,LineBorderFactory~@# script class. This border adds a size of //thickness// rounded down to the next integer value around the widget. |
| |
These additional parameters compared to //Empty// type can be used: | These additional parameters compared to //Empty// type can be used: |
| |
===== Bevel ===== | ===== Bevel ===== |
Creates a border factory drawing a bevelled rectangle around the widget. Creates an instance of the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BevelBorderFactory.html|BevelBorderFactory]] script class. This border adds a size of 1 pixel around the widget. | Creates a border factory drawing a bevelled rectangle around the widget. Creates an instance of the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1BevelBorderFactory.html,BevelBorderFactory~@# script class. This border adds a size of 1 pixel around the widget. |
| |
These additional parameters compared to //Empty// type can be used: | These additional parameters compared to //Empty// type can be used: |
| |
===== Etched ===== | ===== Etched ===== |
Creates a border factory drawing an etched rectangle around the widget. Creates an instance of the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EtchedBorderFactory.html|EtchedBorderFactory]] script class. This border adds a size of 2 pixels around the widget. | Creates a border factory drawing an etched rectangle around the widget. Creates an instance of the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1EtchedBorderFactory.html,EtchedBorderFactory~@# script class. This border adds a size of 2 pixels around the widget. |
| |
These additional parameters compared to //Empty// type can be used: | These additional parameters compared to //Empty// type can be used: |
| |
===== CanvasCreator ===== | ===== CanvasCreator ===== |
Creates a border factory using a canvas creator. The canvas creator should not draw the center since borders are laid over the widget. Creates an instance of the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1CanvasCreatorBorderFactory.html|CanvasCreatorBorderFactory]] script class. Make sure to always set the right //size// parameter. This parameter defines the amount of space reserved around the widget for the border to draw. Inside this area no border should draw anything since it overlays the widget unless you want special effects like an ice-like border transparently covering parts of the widget for show. | Creates a border factory using a canvas creator. The canvas creator should not draw the center since borders are laid over the widget. Creates an instance of the #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Borders_1_1Factories_1_1CanvasCreatorBorderFactory.html,CanvasCreatorBorderFactory~@# script class. Make sure to always set the right //size// parameter. This parameter defines the amount of space reserved around the widget for the border to draw. Inside this area no border should draw anything since it overlays the widget unless you want special effects like an ice-like border transparently covering parts of the widget for show. |
| |
These additional parameters compared to //Empty// type can be used: | These additional parameters compared to //Empty// type can be used: |