WoW:XML/BackdropTemplate

From AddOn Studio
Jump to navigation Jump to search

XML UI ← XML templates < BackdropTemplate

BackdropTemplate is a template that helps create a Frame backdrop in the WoW UI.

Inheritance

Inherited by: many, Inherits: none, Defined in: SharedXML

Requirements

  • a XML/Frame that inherits or indirectly inherits 'BackdropTemplate'
<Frame name="Frame1" inherits="BackdropTemplate">
  • XML/KeyValue with a Key of 'backdropInfo' and type of 'global' who's value is the name of a global variable that holds the desired backdrop layout.
<KeyValues>
	<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global" />
</KeyValues>

Configuration

KeyValue pairs

on the Frame inheriting BackdropTemplate

  • backdropInfo (global, backdropInfo table name) - the main backdrop configuration table, using 'type' 'global' with a string 'value' that's the name of a global Lua 'backdropInfo' table. Can use one of the many WoW predefined 'backdropInfo' default tables, like BACKDROP_DIALOG_32_32.
<KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global" />
  • backdropColor (number) or (global, color table name) - default none. 'value' is one of the predefined or a user defined global Lua color table constants, used to set backdrop background vertex color values, set on load by BackdropTemplate SetBackdropColor(r, g, b, a) which uses SetVertexColor(r, g, b, a or 1) on the background texture, if any. If no background texture is defined, then has no effect.
  • backdropColorAlpha (number) - 0 to 1. default 1. used to override alpha for the backdrop background texture, set on load by BackdropTemplate SetBackdropColor(r, g, b, a) which uses SetVertexColor(r, g, b, a or 1) on the background texture, if any. If no background texture is defined, then has no effect.
<KeyValue key="backdropColor" value="BLACK_FONT_COLOR" type="global"/>
<KeyValue key="backdropColorAlpha" value="0.9" type="number"/>
  • backdropBorderColor (number) or (global, color table name) - default none. 'value' is one of the predefined or a user defined global Lua color table constants, used to set backdrop background vertex color values, set on load by BackdropTemplate SetBackdropBorderColor(r, g, b, a) which uses SetVertexColor(r, g, b, a or 1) on the edge textures, if any. If no edge texture is defined, then has no effect.
  • backdropBorderColorAlpha (number) - 0 to 1. default 1. used to override alpha for the backdrop border texture, set on load by BackdropTemplate SetBackdropBorderColor(r, g, b, a) which uses SetVertexColor(r, g, b, a or 1) on the edge textures, if any. If no edge texture is defined, then has no effect.
  • backdropBorderBlendMode (string) - overrides the blend/alpha mode for the 8 backdrop edge pieces, set on load by BackdropTemplate SetBorderBlendMode(blendMode) which uses SetBlendMode(blendMode) on each edge piece. See XML/ALPHAMODE for list of options.
<KeyValue key="backdropInfo" value="BACKDROP_CALLOUT_GLOW_0_20" type="global"/>
<KeyValue key="backdropBorderBlendMode" value="ADD" type="string"/>
'backdropInfo' table options

which must be defined outside of FrameXML in Lua

  • bgFile (string) - the resource path to the backdrop background texture
  • edgeFile (string) - the resource path to the backdrop edge texture
  • tile (boolean) - if background is tiled, true to tile
  • tileEdge (boolean) - if the top, bottom, right, left edge texture components are tiled, true to tile
  • tileSize (number) - default is 32. the size of section of the texture to use for the background when tiled, starting at x,y 0,0 to a width and height of 'tileSize'. the top rendered row will repeat the tiled portion of the texture, while the remainder of the background will only use the bottom row of pixels of the tile, to repeat as tiles to the bottom of the background area.
  • edgeSize (number) - default is 32. width and height of texture source and drawn edge pieces
  • insets (table) - the edge and background rendering offsets relative to the natural bounding box of the frame. like, 'insets = { left = 3, right = 5, top = 3, bottom = 5 },'
    • left (number) - left edge inset amount toward the right
    • right (number) - right edge inset amount toward the left
    • top (number) - top edge inset amount toward the bottom
    • left (number) - bottom edge inset amount toward the top

The backdropInfo table requires one, or both, of 'edgeFile' or 'bgFile', or will be ignored, and the backdrop will not be created.

Notes

  • The BackdropTemplate template directly replaced the older XML/Backdrop type in WoW Retail patch 9.0.1, but still worked in Classic and Era.
  • In Classic and Classic Era patch 2.5.3 and patch 1.14.0 respectively, BackdropTemplate template also replaced Backdrop element, when the version 9 engine was adopted.