View Single Post
11-14-10, 07:42 PM   #28
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar
Join Date: Sep 2010
Posts: 143
Originally Posted by Zagrei View Post
Pretty much. I use it for sThreatMeter, Headline, StUF, TinyDPS, iMinimap, my personal ExpBar addon, I made a backdrop for my actionbars, and probably a few other places as well.

FOR STUF:
Around line 200 of 'bars.lua', change this:
Code:
if db.fade and not f.barfade then
f.barfade = f:CreateTexture(nil, "BORDER")
end

-- five second rule mana tick
to this:
Code:
if db.fade and not f.barfade then
f.barfade = f:CreateTexture(nil, "BORDER")
end

local bg = CreateFrame("Frame", nil, f)
bg:SetBackdrop({
        bgFile = 'Interface\\ChatFrame\\ChatFrameBackground',
	edgeFile = 'Interface\\ChatFrame\\ChatFrameBackground',
	edgeSize = 1,
})
bg:SetBackdropColor(0, 0, 0, .4)
bg:SetBackdropBorderColor(0, 0, 0)
bg:SetFrameLevel(0)
bg:SetPoint("TOPLEFT", f, -1, 1)
bg:SetPoint("BOTTOMRIGHT", f, 1, -1)

-- five second rule mana tick

The ONLY difference, obviously, is the SetBackdrop call. What you do is this:

-You find the frame you want to put the backdrop on
-Find it's name (in this case, 'f')
-Insert the frame's name into the highlighted areas
-/reloadui ingame, and see if it worked! (LOL)

To clarify, the following code is what you use in all of the addons. Don't forget to change the frame names to match the frame you want to attach it to!

Code:
local bg = CreateFrame("Frame", nil, f)
bg:SetBackdrop({
        bgFile = 'Interface\\ChatFrame\\ChatFrameBackground',
	edgeFile = 'Interface\\ChatFrame\\ChatFrameBackground',
	edgeSize = 1,
})
bg:SetBackdropColor(0, 0, 0, .4)
bg:SetBackdropBorderColor(0, 0, 0)
bg:SetFrameLevel(0)
bg:SetPoint("TOPLEFT", f, -1, 1)
bg:SetPoint("BOTTOMRIGHT", f, 1, -1)
You may not always try the right frame the first time, but that just takes trial and error. You'll get the hang of it quickly Lemme know if you need more help/explanation!
I tried it but still having trouble when u said replace the red f's with frame name it confused. im sorry but im not that good at lua.
but could you give me an example of what you mean by the name instead of the f such as the player frame.
  Reply With Quote