WoW:XML/Value: Difference between revisions

From AddOn Studio
< XML
Jump to navigation Jump to search
(Created page with "{{uixmltype}} Value is a type used for a variety of purposes for defining single numerical values relating to size or position. See the [[XML/Dimension|Dimensio...")
 
mNo edit summary
Line 4: Line 4:


== Inheritance ==
== Inheritance ==
Inherited by: none, Inherits: none, Defined in: [[XML/Backdrop|Backdrop]],[[XML/FontString|FontString]]
Inherited by: none, Inherits: none, Defined in: [[XML/Backdrop|Backdrop]], [[XML/FontString|FontString]]


== Elements ==
== Elements ==

Revision as of 03:42, 12 January 2021

XML UI ← XML types < Value

Value is a type used for a variety of purposes for defining single numerical values relating to size or position. See Dimension for numerical value pairs use type. Value is used for properties such as FontHeight and TileSize.

Inheritance

Inherited by: none, Inherits: none, Defined in: Backdrop, FontString

Elements

  • <AbsValue> - defines a relative or absolute value, using 'absolute' unit based coordinates
  • <RelValue> - defines a relative or absolute value, using 'relative' scalar coordinates

Attributes

  • val (int) - defines a numerical unit based value

Summary

Value based elements facilitate the 'Layout' mechanism in the WoW UI. Value works by providing a flexible set of constructs by using one of: inline values (val), the AbsValue element, or the RelValue element.

Example

<Frame name="MyFrame">
  <Size x="200" y="200"/>
  <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background"
         edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
    <BackgroundInsets>
      <AbsInset left="11" right="12" top="12" bottom="11"/>
    </BackgroundInsets>
    <TileSize val="32"/>
    <EdgeSize val="32"/>
  </Backdrop>
  <Layers>
    <Layer>
      <FontString text="Bob" inherits="MyFont">
        <Size x="100" y="100"/>
        <FontHeight>
          <AbsValue val="12"/>
        </FontHeight>
        <Anchors>
          <Anchor point="TOP"/>
        </Anchors>
      </FontString>
    </Layer>
  </Layers>
</Frame>

This example demonstrates use of FontHeight using Abs, and TileSize and EdgeSize using inline values.

Details