Frame:SetBackdrop()
![]() |
This is no longer a part of the World of Warcraft API.
|
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.
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
Patch 9.0.1 (2020-10-13): Removed; Backdrop related APIs can be inherited from BackdropTemplate
Patch 1.7.0 (2005-09-13): Added.[1]
See Also
- Frame:SetBackdropColor()
- Frame:SetBackdropBorderColor()
- TooltipBackdropTemplate
- TooltipBorderBackdropTemplate
External links
GitHub FrameXML, Gethe
References
- ^
Slouken. Re: Upcoming 1.7 Changes - Concise List. Archived from the original