WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Headline transparency (https://www.wowinterface.com/forums/showthread.php?t=38985)

iradex 02-19-11 07:26 AM

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 :(

nin 02-19-11 10:38 AM

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

Zagrei 02-19-11 11:25 AM

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 :D

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

Zagrei 02-19-11 11:45 AM

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!

iradex 02-19-11 12:29 PM

Quote:

Originally Posted by nin (Post 230091)
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

Quote:

Originally Posted by Zagrei (Post 230094)
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 :D

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


It worked guys. Thanks for the help :) s2

Zagrei 02-19-11 12:46 PM

Glad to be of service :)


All times are GMT -6. The time now is 04:09 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI