Difference between revisions of "Property Element"
Rebranding XML "traits" as "attributes"; minor wording changes
imported>Low Post m (→Text) |
imported>JRoush (Rebranding XML "traits" as "attributes"; minor wording changes) |
||
Line 1: | Line 1: | ||
Property Elements are a subgroup of the elements in the [[:Category: Oblivion XML|Oblivion XML]] schema, always found as children of [[Object Element]]s. They define the properties of their parent element - position on the screen, color, texture, etc. In this sense they are similar to traditional xml [[ | Property Elements are a subgroup of the elements in the [[:Category: Oblivion XML|Oblivion XML]] schema, always found as children of [[Object Element]]s. They define the properties of their parent element - position on the screen, color, texture, etc. In this sense they are similar to traditional xml '''traits'''. | ||
A '''Note''' on the name - Bethesda apparently referred to these elements as "Traits" internally. Likewise, they are called "traits" in the OBSE documentation and several script functions. As noted above, this makes sense given their purpose. However, strictly speaking they are ''elements'' - true XML traits are [[XML Attribute|something else entirely]]. For the purposes of this wiki, the name "Property Element" was chosen to be clear and unambiguous. | |||
There are two basic data types for properties - numeric and string. A number of Oblivion-specific XML entities are defined for commonly used constants of both types. Particularly useful are the numeric entities "&true;" (numeric value 2) and "&false;" (1), used to with boolean properties like Visible or Targetable. | There are two basic data types for properties - numeric and string. A number of Oblivion-specific XML entities are defined for commonly used constants of both types. Particularly useful are the numeric entities "&true;" (numeric value 2) and "&false;" (1), used to with boolean properties like Visible or Targetable. | ||
Property elements may contain literal values, | Property elements may contain literal values. However, the real power of Oblivion's XML is that properties can instead have "formulas" expressed using [[Operator Element]]s. The game evaluates a formula every frame to obtain the ''value'' of the property for that frame - see the operator element page for details. | ||
If an object element contains more than one property of the same type, the last one defined will take precedence. If it contains no property elements for an applicable property, the default value is used (usually zero or the empty string). | |||
== General == | == General == | ||
Line 9: | Line 13: | ||
*'''ID''' (Numeric) Specifies which part of the internal menu "class" the element corresponds to, for the purposes of updating and accepting player input. For example, the game treats whatever element has an ID of 3 in the Recharge menu as the exit button, regardless of the type, name, or any other property of the element - if it can be clicked on, then doing so will close the menu. Likewise, the element with ID 2 in the Enchantment Settings menu is treated as the effect icon and will have its filename property updated by the game (even if it shouldn't have one). Valid ID values depend on the menu class, but generally range 1-20. Giving an element an ID not recognized for that menu will have no effect, while changing an existing ID will prevent the element from updating or accepting input. | *'''ID''' (Numeric) Specifies which part of the internal menu "class" the element corresponds to, for the purposes of updating and accepting player input. For example, the game treats whatever element has an ID of 3 in the Recharge menu as the exit button, regardless of the type, name, or any other property of the element - if it can be clicked on, then doing so will close the menu. Likewise, the element with ID 2 in the Enchantment Settings menu is treated as the effect icon and will have its filename property updated by the game (even if it shouldn't have one). Valid ID values depend on the menu class, but generally range 1-20. Giving an element an ID not recognized for that menu will have no effect, while changing an existing ID will prevent the element from updating or accepting input. | ||
*''' | *'''Childcount''' (Numeric) Set automatically by the engine to the number of children the element has. | ||
*'''User#''' (type flexible) Element types beginning in "user" are not in general part of the Oblivion XML schema. They may, however, be recognized by specific menu classes and set to specific values. For example, in most contexts an element of type User4 would be parsed and then ignored. The internal class of the Spellmaking menu, though, will look for a User4 property element that is a child of the root [[Object Element#Menu|Menu element]], and update its value to the current magicka cost. | *'''User#''' (type flexible) Element types beginning in "user" are not in general part of the Oblivion XML schema. They may, however, be recognized by specific menu classes and set to specific values. For example, in most contexts an element of type User4 would be parsed and then ignored. The internal class of the Spellmaking menu, though, will look for a User4 property element that is a child of the root [[Object Element#Menu|Menu element]], and update its value to the current magicka cost. | ||
Line 24: | Line 28: | ||
*'''Alpha''' (Numeric) Value between 0 and 255 that determines transparency of element. An alpha of 255 is normal, but the lower the alpha the the more transparent. At alpha of 0 the element is completely transparent - although it can still respond to mouse clicks, etc. | *'''Alpha''' (Numeric) Value between 0 and 255 that determines transparency of element. An alpha of 255 is normal, but the lower the alpha the the more transparent. At alpha of 0 the element is completely transparent - although it can still respond to mouse clicks, etc. | ||
*'''Depth''' (Numeric) Determines precedence for overlapping elements - those with a higher Depth will be drawn on top. Not that by default, an element always has higher depth than its parent. | *'''Depth''' (Numeric) Determines precedence for overlapping elements - those with a higher Depth will be drawn on top. Not that by default, an element always has higher depth than its parent. | ||
*'''Clips''' (Numeric: Boolean) If the element's (relative) position is outside of its parent element's dimensions it will be hidden. Only works if the parent element | *'''Clips''' (Numeric: Boolean) If the element's (relative) position is outside of its parent element's dimensions it will be hidden. Only works if the parent element's <clipwindow> property is true. | ||
== Mouse Targetable == | == Mouse Targetable == | ||
Line 39: | Line 42: | ||
*'''Zoom''' (Numeric) Specifies the zoom percentage of the image. Setting it to 0 will result in a hidden image and can be larger than 100 to magnify the source texture. When using a value of -1 the image will be resized to fit the width and height of the element (and therefore not cropped). | *'''Zoom''' (Numeric) Specifies the zoom percentage of the image. Setting it to 0 will result in a hidden image and can be larger than 100 to magnify the source texture. When using a value of -1 the image will be resized to fit the width and height of the element (and therefore not cropped). | ||
*'''FileWidth, FileHeight''' (Numeric) Set automatically by the game engine to the actual width in pixels of the loaded texture, after zoom has been applied. For zoom = -1, these values are set to zero. | *'''FileWidth, FileHeight''' (Numeric) Set automatically by the game engine to the actual width in pixels of the loaded texture, after zoom has been applied. For zoom = -1, these values are set to zero. | ||
*'''Tile''' (Numeric: Boolean) If the width or height of the image element is larger than the dimensions of the texture this property will extend the image displayed by stacking (or pasting) two or more of the textures together into one single image. It does not appear to account for any alpha channel the texture may have, only the raw dimensions are used to determine if and where the textures are connected. This can cause problems with lower resolutions as many of the Menus80 textures have an alpha channel to hide the excess content. | |||
*'''CropX,CropY''' (Numeric) Specify the point on the texture, in pixels, that will be placed at the upper left hand corner of the image element. Because the texture is cropped to fit inside the image element, this essentially cuts CropX pixels off of the left of the image and CropY off of the top. '''Note:''' CropX/CropY are calculated ''after'' the zoom property has been applied, so the point (5,10) in the original image would be (10,20) after a 200% zoom. | *'''CropX,CropY''' (Numeric) Specify the point on the texture, in pixels, that will be placed at the upper left hand corner of the image element. Because the texture is cropped to fit inside the image element, this essentially cuts CropX pixels off of the left of the image and CropY off of the top. '''Note:''' CropX/CropY are calculated ''after'' the zoom property has been applied, so the point (5,10) in the original image would be (10,20) after a 200% zoom. | ||
Line 84: | Line 88: | ||
Hello World | Hello World | ||
*'''Wrapwidth''' (Numeric) the maximum width, in pixels, of the element. If the text is long enough to extend past this width, it is split into multiple lines. This is the only way to control the size of a text element - the width and height properties set by the game engine to whatever the final dimensions of the element end up being. | *'''Wrapwidth''' (Numeric) the maximum width, in pixels, of the element. If the text is long enough to extend past this width, it is split into multiple lines. This is the only way to control the size of a text element - the width and height properties set by the game engine to whatever the final dimensions of the element end up being. | ||
*''' | *'''Wraplines''' (Numeric) the maximum number of lines displayed. | ||
*'''IsHTML''' (Numeric) If value is greater than zero, the String Property is [[Book Formatting|parsed as HTML]] before being displayed. ''Note'': This only works if the String property is set by script or the game engine, as HTML-formatted text written directly in the *.xml file is not handled correctly. | *'''IsHTML''' (Numeric) If value is greater than zero, the String Property is [[Book Formatting|parsed as HTML]] before being displayed. ''Note'': This only works if the String property is set by script or the game engine, as HTML-formatted text written directly in the *.xml file is not handled correctly. | ||
*'''PageNum''' (Numeric) In Oblivion, html-formatted text may be broken into pages using the <hr> tag. This property specifies which 'page' of text is actually displayed, with zero meaning the first page, 1 meaning the second page, and so on. | *'''PageNum''' (Numeric) In Oblivion, html-formatted text may be broken into pages using the <hr> tag. This property specifies which 'page' of text is actually displayed, with zero meaning the first page, 1 meaning the second page, and so on. |