[[:start|Start Page]] >> [[dragengine:modules:dragonscript:main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:guitheme|Gui Themes]] >> **Define Parameters**
====== Parameters ======
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 =====
Sets an integer value.
1234
===== Floating Point =====
Sets a floating point value. Supports regular and scientific notation (for example 1e2).
12.34
===== Boolean =====
Sets a boolean value. The values "true", "yes" and "1" are considered true values. The values "false", "no", "0" are considered false values. All other values are considered false. It is recommended to use "true" and "false" with the other possible values to support conversion tools.
true
===== String =====
Sets a string value. This is typically used for parameters allowing the user to choose one or more flags from a set of named flags.
center,middle
===== Color =====
Sets a color value. Color values compose of a red, green, blue and alpha value. If an attribute is not used the default values are red=0, green=0, blue=0 and alpha=1. You can define the value using different notations. You can use any of the forms below but you can not mix them.
===== Color Matrix =====
Sets a color matrix value. Color matrices are defines as a list of individual color matrices concatenated in the order they are defined. This allows to create various combinations. If the list is empty null is used as values instead.
===== 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.
myfont.defont
===== Image =====
Sets an image parameter. Images are engine resources.
myimage.png
===== Video =====
Sets a video parameter. Videos are engine resources. Video parameters are typically played back automatically in a loop by the parameter owner
===== 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.
===== 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.
===== 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.
===== 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.
===== 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.
===== 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.
===== 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.
===== 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.