User Tools

Site Tools


dragengine:modules:dragonscript:xmlguitheme:parameters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dragengine:modules:dragonscript:xmlguitheme:parameters [2018/02/27 13:46] – < dragonlorddragengine:modules:dragonscript:xmlguitheme:parameters [2024/03/14 16:52] (current) dragonlord
Line 6: Line 6:
 Parameters define a value of a specific type to assign to a parameter by name. The last set values for a particular parameter name is used in the end. The supported types are described here. In general all attributes are optional unless marked otherwise. Not defined attributes use the default value. Parameters define a value of a specific type to assign to a parameter by name. The last set values for a particular parameter name is used in the end. The supported types are described here. In general all attributes are optional unless marked otherwise. Not defined attributes use the default value.
  
 +The loader script tries to set the parameter using the provided type. If the parameter does not understand the provided value an exception is thrown. The loader script prints out such problems to the game console and tries to continue if possible. In some cases it is though not possible to continue without a properly set value. While working with parameters always watch the game console to see if some parameters are not properly understood or invalid.
 ===== Integer ===== ===== Integer =====
 Sets an integer value. Sets an integer value.
Line 103: Line 104:
 </code> </code>
  
 +===== Font =====
 +Sets a font parameter. Fonts are engine resources. When you define a font parameter you select the font file to use and the line height in pixels. If the line height does not match the font scaling is required which might look ok or not.
 +
 +<code xml>
 +<font parameter='ParameterName' size='15'>myfont.defont</font>
 +</code>
 +
 +===== Image =====
 +Sets an image parameter. Images are engine resources.
 +
 +<code xml>
 +<image parameter='ParameterName'>myimage.png</image>
 +</code>
 +
 +===== Video =====
 +Sets a video parameter. Videos are engine resources. Video parameters are typically played back automatically in a loop by the parameter owner
 +
 +<code xml>
 +<video parameter='ParameterName'>myvideo.ogv</video>
 +</code>
 +
 +===== Border Size =====
 +Sets a BorderSize parameter. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1BorderSize.html,BorderSize~@# is a script class containing 4 pixel size integer values one for each side. You can define the BorderSize using two different version but you can not mix them. Not used attributes are set to 0.
 +
 +<code xml>
 +<!-- Set border size with all sides set to the same value. -->
 +<borderSize parameter='ParameterName' all='5'/>
 +
 +<!-- Set border size with individual values for each side. Not defined sides are set to 0. -->
 +<borderSize parameter='ParameterName' left='5' top='2' right='5' bottom='2'/>
 +</code>
 +
 +===== Point =====
 +Sets a Point parameter. #@LinkApiDocDEDS2_HTML~classDragengine_1_1Gui_1_1Point.html,Point~@# is a script class containing an X and Y integer coordinate. Not set attributes are 0.
 +
 +<code xml>
 +<!-- Set border size with individual values for each side. Not defined sides are set to 0. -->
 +<point parameter='ParameterName' x='5' y='2'/>
 +</code>
 +
 +===== Canvas Creator =====
 +Sets a CanvasCreator parameter. See [[dragengine:modules:dragonscript:xmlguitheme:canvascreator|Define XML Canvas Creator]] for information about defining canvas creators. See [[dragengine:modules:dragonscript:main#script_examples|Script Examples]] and [[gamedev:canvassystem:introduction|Canvas System]] for general information about canvas creators. Canvas creators can be defined using a type attribute or by loading it from an XML file.
 +
 +<code xml>
 +<canvasCreator parameter='MyCanvasCreator' type='Image'>
 +   <!-- Set canvas creator as instance of ImageCanvasCreator script class -->
 +</canvasCreator>
 +<canvasCreator parameter='MyCanvasCreator2' extend='myCanvasCreator.ccreator.xml'>
 +   <!-- Set canvas creator loading from XML file then modify -->
 +</canvasCreator>
 +</code>
 +
 +===== Border =====
 +Sets a Border parameter. See [[dragengine:modules:dragonscript:xmlguitheme:borderfactory|Define XML Border Factory]] for information about defining border factories. Border factories can be defined using a type attribute or by loading it from an XML file.
 +
 +<code xml>
 +<border parameter='MyBorder' type='Line'>
 +   <!-- Set border factory as instance of BorderLineFactory script class -->
 +</border>
 +<border parameter='MyBorder2' extend='myborder.border.xml'>
 +   <!-- Set border factory loading from XML file then modify -->
 +</border>
 +</code>
 +
 +===== Decoration =====
 +Sets a Decoration parameter. See [[dragengine:modules:dragonscript:xmlguitheme:decoration|Define XML Decoration]] for information about defining decorations. Decorations can be defined using a type attribute or by loading it from an XML file.
 +
 +<code xml>
 +<decoration parameter='MyDecoration' type='CanvasCreator'>
 +   <!-- Set decoration as instance of CanvasCreatorDecorationFactory script class -->
 +</decoration>
 +<decoration parameter='MyDecoration2' extend='mydecoration.decoration.xml'>
 +   <!-- Set decoration loading from XML file then modify -->
 +</decoration>
 +</code>
 +
 +===== Mouse Pointer =====
 +Sets a MousePointer parameter. See [[dragengine:modules:dragonscript:xmlguitheme:mousepointer|Define XML Mouse Pointer]] for information about defining mouse pointers. Mouse pointers can be defined using a type attribute or by loading it from an XML file.
 +
 +<code xml>
 +<mousePointer parameter='MyMousePointer' type='Image'>
 +   <!-- Set mouse pointer as instance of ImageMousePointerFactory script class -->
 +</mousePointer>
 +<mousePointer parameter='MyMousePointer2' extend='mymouse.mpointer.xml'>
 +   <!-- Set mouse pointer loading from XML file then modify -->
 +</mousePointer>
 +</code>
 +
 +===== Widget Designer =====
 +Sets a WidgetDesigner parameter. See [[dragengine:modules:dragonscript:xmlguitheme:widgetdesigners|Define XML Widget Designers]] for information about defining widget designers. Widget designers can be defined using a type attribute, loading it from an XML file or creating a copy of a previously defined named widget designer.
 +
 +<code xml>
 +<designer parameter='MyDesigner' type='Label'>
 +   <!-- Set widget designer as instance of LabelWidgetDesigner script class -->
 +</designer>
 +<designer parameter='MyDesigner2' extend='mydesigner.wdesigner.xml'>
 +   <!-- Set widget designer loading from XML file then modify -->
 +</designer>
 +<designer parameter='MyDesigner3' extendNamed='MyDesigner'>
 +   <!-- Set widget designer creating copy of a previously defined named widget designer -->
 +</designer>
 +</code>
 +
 +===== Null =====
 +Sets a null parameter. Null can be used in place of any other parameter type. It is typically used to clear a previously set parameter for example from a named widget designer or some element loaded from XML file. Depending on the parameter null values may not be allowed.
 +
 +<code xml>
 +<!-- Set parameter to null or empty. In this example the parameter is of type BorderSize and cleared this way. -->
 +<null parameter='ParameterName'/>
 +</code>
  
dragengine/modules/dragonscript/xmlguitheme/parameters.1519739188.txt.gz · Last modified: 2018/02/27 13:46 by dragonlord