Quantcast Greetings And a masking issue - WoWInterface
Thread Tools Display Modes
08-18-10, 05:11 PM   #1
tmcnabb
A Fallenroot Satyr
 
tmcnabb's Avatar
Join Date: Feb 2005
Posts: 22
Greetings And a masking issue

So I am attempting to make a split orb type of health and power. (kind of like Zorks D3's but with a combined orb instead of two separate). I figured out the status bar graphics and what not but for the life of me I can not grasp how to mask the bar so that it fades flat(?) instead of crushing the bar down and spilling out of the sides of the bg. Has anyone tackled this problem already?

Thanks
Nabbs


Code:
  lib.gen_hpbar = function(f)
    --statusbar
    local s = CreateFrame("StatusBar", nil, f)
    
    s:SetHeight(f.height)
    s:SetWidth(f.width)
    s:SetPoint("CENTER",0,0)
    s:SetStatusBarTexture(cfg.left_orb) --right_orb for ppbar
    --s:GetStatusBarTexture():SetHorizTile(true)
    s:SetOrientation("VERTICAL")

    	--bg
    local b = s:CreateTexture(nil, "BACKGROUND")
    b:SetTexture(cfg.orb_back_left) -- orb_back_right for ppbar
    b:SetAllPoints(s)
    f.Health = s
    f.Health.bg = b
  end




moon is from zorks D3 orbs. using till i get this working then I will make my own
  Reply With Quote
08-18-10, 05:36 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
You are doing nothing wrong, that's simply the default behaviour what you are seeing.

You have to take a closer look at how zork solves this (work around) for his orbs. It's connected to the health function. *hint*
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
08-18-10, 05:41 PM   #3
tmcnabb
A Fallenroot Satyr
 
tmcnabb's Avatar
Join Date: Feb 2005
Posts: 22
thanks dawn
  Reply With Quote
08-18-10, 07:30 PM   #4
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
Try to make your own texture. I've got one of my toons using orbs and I did it the easy way.

-----

Okay actually I am bored. Though you may want to still texture it to match the orb you have going, this will give you the half orb texture you are looking for. Just set it as you would a standard rectangular statusbar.


You just need to convert it to tga. And flip it for the right side.



Attached Thumbnails
Click image for larger version

Name:	halfsphere.png
Views:	487
Size:	2.6 KB
ID:	4712  Click image for larger version

Name:	halfspherev.png
Views:	503
Size:	4.5 KB
ID:	4713  
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"

Last edited by Unkn : 08-18-10 at 07:43 PM.
  Reply With Quote
08-18-10, 07:42 PM   #5
tmcnabb
A Fallenroot Satyr
 
tmcnabb's Avatar
Join Date: Feb 2005
Posts: 22
I have the half orb textures and alphas. The problem is the masking or wipe of the lost hp's
  Reply With Quote
08-18-10, 07:45 PM   #6
Unkn
Premium Member
 
Unkn's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 258
I edited my previous post to include pics. I'm using oUF and just standard vertical orientation to the status bars.

yes its sized weird. didn't tweak it to fit my frames.

Your config is looks like resizing the orb texture every time it updates health. Set the height and width in your initial code.
__________________
"I'm very feminine. And I'll beat the crap out of ANYONE who disagrees!"
  Reply With Quote
08-19-10, 10:46 AM   #7
tmcnabb
A Fallenroot Satyr
 
tmcnabb's Avatar
Join Date: Feb 2005
Posts: 22
I will recreate right now and see if I missed something.

Are those the spheres you are useing? Mine are the full size of the UF

Could you post some of the code you used? I was under the impression I had to do some sort of tap dance to get the bars to fade out flat instead of resize on health update. I'm thinking I missed something basic. Like a setting or something I can't find.


Code:
--// from lib.cfg
--init func
  lib.init = function(f)
    f:SetAttribute("initial-height", f.height)
    f:SetAttribute("initial-width", f.width)
    f:SetAttribute("initial-scale", f.scale)
    f:SetPoint("CENTER",UIParent,"CENTER",0,0)
  end  
    
  --gen healthbar func
  lib.gen_hpbar = function(f)
    --statusbar
    local s = CreateFrame("StatusBar", nil, f)
    s:SetStatusBarTexture(cfg.orb_back_left_fill)
    s:SetHeight(f.height)
    s:SetWidth(f.width)
    s:SetPoint("CENTER",0,0)
    s:SetOrientation("VERTICAL")
    s:GetStatusBarTexture():SetHorizTile(false)
    s:GetStatusBarTexture():SetVertTile(false)
    --bg
    local b = s:CreateTexture(nil, "BACKGROUND")
  	b:SetTexture(cfg.orb_back_left_fill)
    b:SetAllPoints(s)
    f.Health = s
    f.Health.bg = b
  end



--// core.lua

 local function CreatePlayerStyle(self)
    --style specific stuff
    self.width = 128
    self.height = 256
    self.scale = 1
    self.mystyle = "player"
    genStyle(self)
    self.Health.frequentUpdates = true
    self.Health.colorClass = true
    self.Health.bg.multiplier = 0.3
    self.Power.colorPower = true
    self.Power.bg.multiplier = 0.3
  end
bah still no love


Last edited by tmcnabb : 08-19-10 at 01:02 PM.
  Reply With Quote
08-19-10, 12:46 PM   #8
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
Maybe try with

GetStatusBarTexture():SetHorizTile(false)
and
GetStatusBarTexture():SetVertTile(false)
  Reply With Quote
08-19-10, 01:03 PM   #9
tmcnabb
A Fallenroot Satyr
 
tmcnabb's Avatar
Join Date: Feb 2005
Posts: 22
Originally Posted by Rostok View Post
Maybe try with

GetStatusBarTexture():SetHorizTile(false)
and
GetStatusBarTexture():SetVertTile(false)
tried that .. it had no effect . I forgot to update the code here after I put it in.
  Reply With Quote
08-19-10, 03:20 PM   #10
tmcnabb
A Fallenroot Satyr
 
tmcnabb's Avatar
Join Date: Feb 2005
Posts: 22
le /cry

update: So I managed to get the orb up and the fill in place. But it refuses to update now and just stays full arrgh. Am I using post update health correctly?
-nabbs
Code:
  
--gen healthbar func
   lib.gen_hpbar = function(f, unit)
--statusbar
    local s = CreateFrame("StatusBar", nil, f)
    s:SetStatusBarTexture(cfg.orb_transparent)--(cfg.statusbar_texture)
    s:SetHeight(f.height)
    s:SetWidth(f.width)
    s:SetPoint("CENTER",0,0)
    s:SetOrientation("VERTICAL")
    --s:GetStatusBarTexture():SetHorizTile(false)
    --s:GetStatusBarTexture():SetVertTile(false)
    
-- filling
    s.Filling = s:CreateTexture(nil, "ARTWORK")
    s.Filling:SetTexture(cfg.orb_back_left_fill)
    s.Filling:SetPoint("BOTTOMLEFT",0,0)
    s.Filling:SetHeight(f.height)
    s.Filling:SetWidth(f.width)
    s.Filling:SetAlpha(1)
    s.Filling:SetBlendMode("add")
    
  
    --bg
    local b = s:CreateTexture(nil, "BACKGROUND")
    b:SetTexture(cfg.orb_back_left_fill)
    b:SetAllPoints(s)
    s.PostUpdate = lib.PostUpdateHealth
    f.Health = s
    f.Health.bg = b
    f.Health.Filling = s.Filling
end


--update player health func
lib.PostUpdateHealth = function(f, event, unit, min, max)
    local d = floor(min/max*100)
    f.Health.Filling:SetHeight((min / max) * self.Health:GetWidth())
    f.Health.Filling:SetTexCoord(0,1,  math.abs(min / max - 1),1)
end
  Reply With Quote
08-20-10, 02:38 AM   #11
Rostok
A Flamescale Wyrmkin
Join Date: Jul 2008
Posts: 127
did you declare your Postupdate function before the declaration of your hb ?

Code:
lib.PostUpdateHealth = function(Health, min, max)
    local d = floor(min/max*100)
    Health.Filling:SetHeight((min / max) * Health:GetWidth())
    Health.Filling:SetTexCoord(0,1,  math.abs(min / max - 1),1)
end
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Greetings And a masking issue

Thread Tools
Display Modes

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