LibBackdrop provides a 100% compatible replacement for SetBackDrop
It also mixes in the following methods to the frame
Mxin methods
SetBackdropGradient(orient,minR,minG,minB,maxR,maxG,maxB)
setup a gradient on the bg texture.
SetBackdropGradientAlpha(orient,minR,minG,minB,minA,maxR,maxG,maxB,maxA)
setup a gradient with alpha on the bg texture
SetBackdropBorderGradient(orient,minR,minG,minB,maxR,maxG,maxB)
setup a gradient on the border texture
SetBackdropBorderGradientAlpha(orient,minR,minG,minB,minA,maxR,maxG,maxB,maxA)
setup a gradient with alpha on the border texture
GetBackdropBorderSection(section)
get a reference to a section of the border
[Valid values are: TOPLEFTCORNER,TOP,TOPRIGHTCORNER,LEFT,RIGHT,BOTLEFTCORNER,BOT,BOTRIGHTCORNER]
GetBackdropBackground
get a reference to the backdrop background texture itself
BorderTextureFunction(function name, params)
this method allows you to call a function on each border texture, passing whatever params you want. This is a convience method, instead of having to fetch each subtexture to call some method. Example usage frame:BorderTextureFunction("SetDrawLayer","ARTWORK") to raise the border draw layer
Library High Level Function
IsEnhanced(frame)
test if a frame has already been enhanced
EnhanceBackdrop (frame)
embed the mixins into a given frame
To Use:
local BD = LibStub("LibBackdrop-1.0") -- Create a frame as normal local testFrame = CreateFrame("Frame","Test Frame",UIParent) -- Embed the new backdrop functions BD:EnhanceBackdrop(testFrame) -- Use as you would normally testFrame: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 }}) --Now for some coloring fun -- Set the border to gradient upward from red to green testFrame:SetBackdropBorderGradient("vertical",1,0,0,0.5,1,0) -- Set the background image to color from blue to green testFrame:SetBackdropGradient("VERTICAL",0,0,1,0,1,0)
Here is the result of the above code http://dl.dropbox.com/u/10956/LibBackDrop-Example.png
- 1 comment
- 1 comment
Facts
- Date created
- Sep 30, 2010
- Categories
- Last update
- Nov 29, 2011
- Development stage
- Release
- License
- All Rights Reserved
- Curse link
- LibBackdrop-1.0
- Downloads
- 1,824
- Recent files
- A: 1.1.0-1-gd76b455 for 3.3.5 Nov 29, 2011
- R: 1.1.0 for 4.1 Apr 28, 2011
- A: 1.0.9-2-g1904a6d for 4.1 Apr 28, 2011
- A: 1.0.9-1-g7f75879 for 4.0.3a Jan 10, 2011
- R: 1.0.9 for 4.0.3a Jan 08, 2011
Relationships
- Embedded library
- LibStub
- Reply
- #1
kagaro Oct 01, 2010 at 20:00 UTC - 0 likesPackager is a little slow going, 1.0.4 tag when ever it builds has the BorderTextureFunction included in it.