Difference between revisions of "Property Element"

427 bytes added ,  13:16, 21 December 2023
no edit summary
imported>JRoush
(Rebranding XML "traits" as "attributes"; minor wording changes)
Tag: Manual revert
 
(5 intermediate revisions by 3 users not shown)
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 '''traits'''.
== Overview ==


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.     
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 [http://www.w3schools.com/xml/xml_attributes.asp attributes].
 
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.  This makes sense given their purpose - in XML "trait" is often used synonymously with "attribute".  However, strictly speaking the subjects of this article are ''elements''.  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.  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.
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.  


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).
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).
A property (and its operators) is only updated when one of the source properties changes. Either by the engine itself or through scripting. When the property has been updated and the value is different from last time it will continue to update any properties that use it (can be called "derived properties"). This may then repeat itself for each subsequent derived property. A Golden Rule is that nothing gets updated as long as nothing is changed, in that sense there are no 'frames' for the UI.


== General ==
== General ==
Line 27: Line 31:
*'''Visible''' (Numeric: Boolean) If true, the element is visible, and if false the element is hidden.  Hiding an element will reveal the elements under it (parents or siblings with lower Depth).  Hidden elements cannot be clicked or moused over, but can still be activated from scripts using OBSE's [[ClickMenuButton]] function.
*'''Visible''' (Numeric: Boolean) If true, the element is visible, and if false the element is hidden.  Hiding an element will reveal the elements under it (parents or siblings with lower Depth).  Hidden elements cannot be clicked or moused over, but can still be activated from scripts using OBSE's [[ClickMenuButton]] function.
*'''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.  Note 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's <clipwindow> property is true.
*'''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.


Anonymous user