WoW:API Frame SetBackdrop: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API Frame SetBackdrop to API Frame SetBackdrop without leaving a redirect)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Syntax ==
{{widgetmethod}}


SetBackdrop({bgFile = "bgFile", edgeFile = "edgeFile", tile = false, tileSize = 0, edgeSize = 32, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
 
Frame:SetBackdrop( {  
  bgFile = "bgFile",  
  edgeFile = "edgeFile", tile = false, tileSize = 0, edgeSize = 32,  
  insets = { left = 0, right = 0, top = 0, bottom = 0 }
});




Using 'nil' as the only parameter will remove the backdrop on the indicated frame.
Using 'nil' as the only parameter will remove the backdrop on the indicated frame.
== Arguments ==
:;bgFile:String - Which texture file to use as frame background (.blp or .tga format)
:;[[edgeFiles|edgeFile]]:String- Which texture file to use as frame edge blp or .tga format)
:;tile:Boolean - whether background texture is tiled or streched
:;tileSize:Number - Control how large each copy of the bgFile becomes on-screen
:;edgeSize:Number - Control how large each copy of the edgeFile becomes on-screen (i.e. border thickness and corner size)
:;insets:4 x Number - Controls how far into the frame the background will be drawn (use higher values the thicker the edges are)


== Example ==
== Example ==
MinimapCluster:SetBackdrop({bgFile = "Interface\Tooltips\UI-Tooltip-Background", edgeFile = "Interface\Tooltips\UI-Tooltip-Border", tile = true, tileSize = 32, edgeSize = 32, insets = { left = 0, right = 0, top = 0, bottom = 0 }})
MinimapCluster:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",  
--[[User:Nathanmx|Nathanmx]] 03:23, 1 Oct 2005 (EDT)
                                            edgeFile = "Interface/Tooltips/UI-Tooltip-Border",  
 
                                            tile = true, tileSize = 16, edgeSize = 16,  
Note that it looks pretty retarded without any insets. And if you do not escape the backslashes, it will not work at all. Just use slashes, geez.<br />
                                            insets = { left = 4, right = 4, top = 4, bottom = 4 }});
[[User:Loriel|Loriel]] 09:35, 2 Nov 2005 (EST)
MinimapCluster:SetBackdropColor(0,0,0,1);
 
== See Also ==
{{template:WoW API}}
* [[edgeFiles]]
* [[API SetBackdropColor|SetBackdropColor]]
* [[API SetBackdropBorderColor|SetBackdropBorderColor]]

Latest revision as of 04:45, 15 August 2023

Widget API ← Frame < SetBackdrop


Frame:SetBackdrop( { 
  bgFile = "bgFile", 
  edgeFile = "edgeFile", tile = false, tileSize = 0, edgeSize = 32, 
  insets = { left = 0, right = 0, top = 0, bottom = 0 }
});


Using 'nil' as the only parameter will remove the backdrop on the indicated frame.

Arguments[edit]

bgFile
String - Which texture file to use as frame background (.blp or .tga format)
edgeFile
String- Which texture file to use as frame edge blp or .tga format)
tile
Boolean - whether background texture is tiled or streched
tileSize
Number - Control how large each copy of the bgFile becomes on-screen
edgeSize
Number - Control how large each copy of the edgeFile becomes on-screen (i.e. border thickness and corner size)
insets
4 x Number - Controls how far into the frame the background will be drawn (use higher values the thicker the edges are)

Example[edit]

MinimapCluster:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", 
                                            edgeFile = "Interface/Tooltips/UI-Tooltip-Border", 
                                            tile = true, tileSize = 16, edgeSize = 16, 
                                            insets = { left = 4, right = 4, top = 4, bottom = 4 }});
MinimapCluster:SetBackdropColor(0,0,0,1);

See Also[edit]