Thread Tools Display Modes
02-19-11, 07:26 AM   #1
iradex
A Cyclonian
Join Date: Nov 2009
Posts: 43
Headline transparency

Hello guys, well, i'm using

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)
on Stuf Unit Frames and Acb_castbar to set it transparency, and i'm trying to use it on Headline, buti can't find where to put the code, and the frame name. Need some help
  Reply With Quote
02-19-11, 10:38 AM   #2
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
What you posted there is adding a background with 0.4 alpha.

What part of headline is it exactly that you want too add transparency too?

If it's the background you can probably just edit any of these values .. i just took a quick peek at headlines code..

Code:
hpbg:SetTexture(0, 0, 0,0.4)
Code:
if(UnitName('target') and frame:GetAlpha() == 1) then
			frame.bg:SetTexture(1, 1, 1,0.4)
		else
			frame.bg:SetTexture(0, 0, 0,0.4)
		end
-_-V
  Reply With Quote
02-19-11, 11:25 AM   #3
Zagrei
A Cobalt Mageweaver
 
Zagrei's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2009
Posts: 246
I made Headline look that way a while ago, and I perused through the code, trying to find what I edited... to no avail. However, I guess I could post the entirety of my Headline code, even though there is no educational value in that... I'll keep looking first It's better to learn how to figure these things out than to have someone always hand it to ya

EDIT: Look down, the next post has the info
__________________

Last edited by Zagrei : 02-19-11 at 11:46 AM.
  Reply With Quote
02-19-11, 11:45 AM   #4
Zagrei
A Cobalt Mageweaver
 
Zagrei's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2009
Posts: 246
Wall of text incoming! Here are the changes that you are gonna have to make
Code:
if(UnitName('target') and frame:GetAlpha() == 1) then
	frame.bg:SetTexture(0, 0, 0)

Code:
local function SkinObjects(frame)
	local hp, cb = frame:GetChildren()
	local threat, hpborder, cbshield, cbborder, cbicon, overlay, oldname, level, bossicon, raidicon, elite = frame:GetRegions()

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



	local offset = UIParent:GetScale() / hp:GetEffectiveScale()
	local hpbg = hp:CreateTexture(nil, 'OVERLAY')
	hpbg:SetPoint('BOTTOMRIGHT', offset, -offset)
	hpbg:SetPoint('TOPLEFT', -offset, offset)
	hpbg:SetTexture(0, 0, 0)
	hpbg:SetAlpha(0)
	frame.bg = hpbg

	local hpbg2 = hp:CreateTexture(nil, 'OVERLAY')
	hpbg2:SetAllPoints(hp)
	hpbg2:SetTexture(0, 0, 0)
	hpbg2:SetAlpha(0)

Code:
local cbbg2 = cb:CreateTexture(nil, 'OVERLAY')
cbbg2:SetAllPoints(cb)
cbbg2:SetTexture(0, 0, 0)
cbbg2:SetAlpha(0)

That SHOULD be all. Keep in mind that I use an older version, so there might be one or two things that have changed. I looked through the newer version, though, and it looks like it should work just fine. Lemme know if it works or not!
__________________
  Reply With Quote
02-19-11, 12:29 PM   #5
iradex
A Cyclonian
Join Date: Nov 2009
Posts: 43
Originally Posted by nin View Post
What you posted there is adding a background with 0.4 alpha.

What part of headline is it exactly that you want too add transparency too?

If it's the background you can probably just edit any of these values .. i just took a quick peek at headlines code..

Code:
hpbg:SetTexture(0, 0, 0,0.4)
Code:
if(UnitName('target') and frame:GetAlpha() == 1) then
			frame.bg:SetTexture(1, 1, 1,0.4)
		else
			frame.bg:SetTexture(0, 0, 0,0.4)
		end
-_-V
Originally Posted by Zagrei View Post
I made Headline look that way a while ago, and I perused through the code, trying to find what I edited... to no avail. However, I guess I could post the entirety of my Headline code, even though there is no educational value in that... I'll keep looking first It's better to learn how to figure these things out than to have someone always hand it to ya

EDIT: Look down, the next post has the info

It worked guys. Thanks for the help s2
  Reply With Quote
02-19-11, 12:46 PM   #6
Zagrei
A Cobalt Mageweaver
 
Zagrei's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2009
Posts: 246
Glad to be of service
__________________
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Headline transparency


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off