Frame:SetBackdrop()

From Wowpedia
Jump to: navigation, search

Sets the backdrop texture of a frame.

Frame:SetBackdrop(nil or { -- defaults
	bgFile = "bgFile",
	edgeFile = "edgeFile",
	tile = false,
	tileEdge = false,
	tileSize = 0,
	edgeSize = 32,
	insets = { left = 0, right = 0, top = 0, bottom = 0 }
})

Arguments

bgFile 
string - Texture path to use for the background
edgeFile 
string - Texture path to use for the edges
tile 
boolean - True if the background texture should tile, false if it should stretch
tileSize 
number - If tile is true, size of each tiled copy of the bgFile
tileEdge 
boolean
edgeSize 
number - Size of the edgeFile (i.e. border thickness and corner size)
insets - left, right, top, bottom 
number - How far from the edges the background will be drawn (e.g. use higher values for thicker edges)

Details

  • Passing nil as the only argument removes the backdrop.

Example

Sets a backdrop with UI-Tooltip-Background and UI-Tooltip-Border (FrameXML example). Inherits from "BackdropTemplate" in patch 9.0.1 if available.

Backdrop colored blue, 50% transparency
local f = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate")
f:SetPoint("CENTER")
f:SetSize(128, 128)
f:SetBackdrop({
	bgFile = "Interface/Tooltips/UI-Tooltip-Background",
	edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
	edgeSize = 16,
	insets = { left = 4, right = 4, top = 4, bottom = 4 },
})
f:SetBackdropColor(0, 0, 1, .5)

Patch changes

See Also

External links

References