Changes between Version 2 and Version 3 of GUI_-_Properties
- Timestamp:
- Jul 9, 2021, 1:55:32 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GUI_-_Properties
v2 v3 4 4 myobject.color = newcolor; 5 5 }}} 6 7 Now the important part is this, the above can be done with not just properties, there is for instance a way to fetch the parent by typing "myobject.parent" also. This is, however, not a setting and won't be listed below. It is taken care of solely when talking about the GUI's Javascript interface. 8 {{Template:TODO|Gee|Add link to javascript interface.}} 6 Now the important part is this, the above can be done with not just properties, there is for instance a way to fetch the parent by typing "myobject.parent" also. This is, however, not a setting and won't be listed below. It is taken care of solely when talking about the GUI's Javascript interface. {{Template:TODO|Gee|Add link to javascript interface.}} 9 7 10 8 The '''default''' values are used to save space. Know the '''defaults''', and know your '''styles'''' defaults, and you'll have a lot cleaner XML files. 11 9 12 10 = Foundation Settings = 13 14 11 The '''Foundation Settings''' are the premise of any object, they differ from '''Base Settings''' as they cannot be changed. 15 12 … … 43 40 44 41 = Base Settings = 45 46 42 Settings shared between all types of object. 47 43 … … 50 46 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)" 51 47 52 If set to '''false''', the child's position, size and "height" (z) is relative to its parent's coordinates; they are calculated as delta values added to its parent's values ("0 0 100% 100%" would set it to the dimensions of its parent, and it could not exceed that border). 48 If set to '''false''', the child's position, size and "height" (z) is relative to its parent's coordinates; they are calculated as delta values added to its parent's values ("0 0 100% 100%" would set it to the dimensions of its parent, and it could not exceed that border). 53 49 54 50 This is handy when you want to link the position of an object(s) to another object. For example, a group of buttons could then be shifted in position by a few pixels without having to separately update each control's size value. … … 82 78 * value: [wiki:GUI_-_Data_Types#name name] 83 79 84 Hotkey variables are declared in an appropriate .cfg file (such as binaries/config/system.cfg) by prefixing the variable with "hotkey." 80 Hotkey variables are declared in an appropriate .cfg file (such as binaries/config/system.cfg) by prefixing the variable with "hotkey." 85 81 86 82 Object properties do not require the prefix, so if the .cfg variable is declared as ''hotkey.toggle.fps'', reference it using the object property ''hotkey="toggle.fps"''. … … 108 104 An object's "Z value" specifies its drawing order. An object with a higher Z will be layered on top of an object with a lower Z. 109 105 110 By default, all root (parentless) objects have a Z value of "0". Children will - if not manually set - have the value of its parent's Z plus 10. 106 By default, all root (parentless) objects have a Z value of "0". Children will - if not manually set - have the value of its parent's Z plus 10. 111 107 112 108 Since Z values are set automatically, this should only need to be specified in rare circumstances (such as when two siblings overlap each other). Generally just defining the objects in sequence should layer them in the right order. 113 109 114 110 = Extended Settings = 115 116 111 Settings that are only used by certain types of object. 117 112 … … 125 120 * default: * 126 121 * value: [wiki:GUI_-_Data_Types#float float] 122 127 123 {{Template:TODO|Gee|* Just add a default value to the default style and update this.}} 128 124 … … 144 140 <object name="whatever" type="text">This is the caption</object> 145 141 }}} 146 147 142 It is however called the caption when stored as a property of the object, and can be accessed as such through JS script: 148 143 … … 151 146 whatever.caption = "Some other text" 152 147 }}} 153 154 148 Captions are special strings that can accept a number of formatting tags. See the [wiki:GUI_-_Text_Renderer Text Renderer] sections for more information. 155 149 … … 158 152 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)" 159 153 160 If set to "false", the control uses its "sprite*" properties to determine which artwork is displayed. (An empty box, for example.) 161 If set to "true", the control uses its "sprite2*" properties to determine which artwork is displayed. (A checked box, for example.) 154 If set to "false", the control uses its "sprite*" properties to determine which artwork is displayed. (An empty box, for example.) If set to "true", the control uses its "sprite2*" properties to determine which artwork is displayed. (A checked box, for example.) 162 155 163 156 == cell_id == … … 172 165 * default: * 173 166 * value: [wiki:GUI_-_Data_Types#float float] 167 174 168 {{Template:TODO|Gee|* Just add a default value to the default style and update this.}} 175 169 … … 181 175 * default: * 182 176 * value: [wiki:GUI_-_Data_Types#float float] 177 183 178 {{Template:TODO|Gee|* Just add a default value to the default style and update this.}} 184 179 185 In Windows, the size of a dropdown is specified as the perimeter of the whole control when opened, and then the height when closed is set to one row. This manually specifies this value, so the size of the dropdown is the size when closed. 180 In Windows, the size of a dropdown is specified as the perimeter of the whole control when opened, and then the height when closed is set to one row. This manually specifies this value, so the size of the dropdown is the size when closed. 186 181 187 182 Check out the [wiki:GUI_-_Drop-down Drop-down] for an image of this. … … 197 192 == fov_wedge_color == 198 193 {{Template:TODO|Gee|I know this is for the Minimap control, but I can't see it ever being used in the code.}} 199 200 == input_init_value_destroyed_at_focus ==201 '''Not yet implemented.'''202 * default: "false"203 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)"204 205 Used by the input box. If set to true, the initial caption of the input box (eg "Insert Text Here") is removed the first time the control is clicked.206 194 207 195 == list == … … 216 204 * Default: * 217 205 * Value: [wiki:GUI_-_Data_Types#int int] 206 218 207 {{Template:TODO|Gee|* Just add a default value to the default style and update this.}} 219 208 … … 226 215 Should the [wiki:GUI_-_Input Input] control word-wrap or scroll horizontally when reaching the right edge? True and it'll continue on the next row. 227 216 217 == placeholder_color == 218 * default: "0 0 0" 219 * value: [wiki:GUI_-_Data_Types#color color] 220 221 Specifies the color of the initial label in the input field (e.g. "255 255 255" for white text). For more information about color settings, see [wiki:GUI_-_Data_Types#color color]. 222 223 == placeholder_text == 224 * default: "null" 225 * value: [wiki:GUI_-_Data_Types#string string] 226 227 Used by the input field. If set, an initial label is displayed in the input field (e.g. "Insert text here"), which is removed when the first text is entered. 228 228 229 == scrollbar == 229 230 * default: "false" 230 231 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)" 231 232 232 If set to "true", the control displays its attached scrollbar at all times, not just when the length of its caption exceeds the size of the object. 233 '''Not yet implemented.''' As of now, there's no automatic detection that will make a scrollbar appear only when needed. 233 If set to "true", the control displays its attached scrollbar at all times, not just when the length of its caption exceeds the size of the object. '''Not yet implemented.''' As of now, there's no automatic detection that will make a scrollbar appear only when needed. 234 234 235 235 == scrollbar_style == … … 313 313 * value: [wiki:GUI_-_Data_Types#name name] 314 314 315 Used by controls that can be switched to another state or consist of more than one sprite. This specifies the "secondary sprite" used when the object is in its secondary mode. 315 Used by controls that can be switched to another state or consist of more than one sprite. This specifies the "secondary sprite" used when the object is in its secondary mode. 316 316 317 317 == sprite2_disabled == … … 348 348 * default: "left" ("center" for type "button") 349 349 * value: [wiki:GUI_-_Data_Types#enum enum] "(left|center|right)" 350 350 351 '''Not yet implemented.''' The button does not have a special default on this value. 351 352 … … 355 356 * default: "top" ("center" for types "button", "checkbox" and "radiobutton") 356 357 * value: [wiki:GUI_-_Data_Types#enum enum] "(top|center|bottom)" 358 357 359 '''Not yet implemented.''' The button, checkbox and radiobutton does not have a special default on this value. 358 360 … … 409 411 * value: [wiki:GUI_-_Data_Types#string string] 410 412 411 Specifies the name of the style of tooltip to display when this object is "hovered". 413 Specifies the name of the style of tooltip to display when this object is "hovered". 412 414 413 415 If not specified, the object uses the tooltip called ''default''. … … 419 421 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)" 420 422 421 Specifies whether to mask text (like in a password field). 423 Specifies whether to mask text (like in a password field). 422 424 423 425 == mask_char == … … 425 427 * value: [wiki:GUI_-_Data_Types#string string] 426 428 427 Specifies what character to mask text with if mask is true. 429 Specifies what character to mask text with if mask is true.