XML/Frame

From Wowpedia
< XML
Jump to: navigation, search

<Frame> constructs a Frame widget, the highest-level concrete type for interactable objects and containers. A frame also contains <Layers> and <Scripts> to customize appearance and user interaction.


Inheritance

<Frame> inherits all characteristics of <LayoutFrame>, and several other elements inherit from <Frame>

Elements

See also: CreateFrame(frameType [, frameName, parentFrame, inheritsFrame, id])

<Frame> resides in either the document root, UI, or the <Frames></Frames> element of another frame.

<UI>
  <Frame>
    <TitleRegion />
    <ResizeBounds>
      <minResize />
      <maxResize />
    </ResizeBounds>
    <Backdrop>
      <!-- Classic only from 9.0.1 -->
      <BackgroundInsets />
      <TileSize />
      <EdgeSize />
      <Color />
      <BorderColor />
    </Backdrop>
    <BackgroundInsets />
    <HitRectInsets />
    <Layers>
      <Layer>
        <Texture />
        <MaskTexture />
        <FontString />
        <Line />
      </Layer>
    </Layers>
    <Frames>
      <Frame />
    </Frames>
    <Scripts />
    <!-- Also see <LayoutFrame> -->
  </Frame>
</UI>

Attributes

<Frame> has all the attributes of <LayoutFrame> plus the following:

XML attribute Type Default Lua equivalent
alpha xs:float
1.0
Region:SetAlpha(alpha)
parent xs:string CreateFrame(__, __, parent, __)
toplevel xs:boolean
false
Frame:SetTopLevel(toplevel)
flattenRenderLayers xs:boolean
false
Frame:SetFlattensRenderLayers(flattenRenderLayers)
useParentLevel xs:boolean
false
frame:SetFrameLevel(frame:GetParent():GetFrameLevel())
movable xs:boolean
false
Frame:SetMovable(movable)
resizable xs:boolean
false
Frame:SetResizable(resizable)
frameStrata ui:FRAMESTRATA
PARENT
Frame:SetFrameStrata("frameStrata")
frameLevel xs:int Frame:SetFrameLevel(frameLevel)
id xs:int
0
Frame:SetID(id)
enableMouse xs:boolean
false
enableMouseClicks xs:boolean
false
Frame:SetMouseClickEnabled(enableMouseClicks)
enableMouseMotion xs:boolean
false
Frame:SetMouseMotionEnabled(enableMouseMotion)
enableKeyboard xs:boolean
false
Frame:SetKeyboardEnabled(enableKeyboard)
clampedToScreen xs:boolean
false
Frame:SetClampedToScreen(clampedToScreen)
protected xs:boolean
false
depth xs:float
0.0
Frame:SetDepth(depth)
dontSavePosition xs:boolean
false
Frame:SetDontSavePosition()
propagateKeyboardInput xs:boolean
false
Frame:SetPropagateKeyboardInput(propagateKeyboardInput)
ignoreParentAlpha xs:boolean
false
Region:SetIgnoreParentAlpha(ignoreParentAlpha)
ignoreParentScale xs:boolean
false
Region:SetIgnoreParentAlpha(ignoreParentScale)
intrinsic xs:boolean
false
clipChildren xs:boolean
false
Frame:SetClipsChildren(clipChildren)
propagateHyperlinksToParent xs:boolean
false
hyperlinksEnabled xs:boolean
false
Frame:SetHyperlinksEnabled(hyperlinksEnabled)

Details

  • <Frame> responds to UI interaction and game-state changes through the OnEvent handler, written as <Scripts><OnEvent /></Scripts>
  • <Frame> extends <LayoutFrame> by introducing a z axis for placing objects in-front or behind others
    • Frame Strata defines intervals in the z axis labelled "LOW", "MEDIUM", "HIGH", etc. with the special value "PARENT" to indicate inheritance
    • Frame Level further divides each frameStrata into smaller intervals numbered 0-10000
      • However, the XML schema provides only limited control via toplevel and useParentLevel attributes.
      • During runtime, the method Frame:SetFrameLevel(level) provides greater access to all of these intervals
  • <Frame> provides the XML schema relating to abstract class LayeredRegion, written as <Layers><Layer /></Layers> and dividing the z-axis even further into Layers
  • <Frame> can parent another <Frame>, written as <Frames><Frame /></Frames
  • An intrinsic frame is like a virtual XML template, but its name becomes a new XML element or can be used in the first argument of CreateFrame(). An intrinsic frame's scripts may also apply the intrinsicOrder attribute.[1]

Patch changes

References

 
  1. ^ a b Blizzard Entertainment Ornyx 2016-10-04. Notable UI Changes Coming in 7.1. Archived from the original
  2. ^ 2014-12-06, UI.xsd, version 1.1.2.4115, near line 307, archived at Townlong-Yak