• 0

    posted a message on masking for Health and Power bars
    It is in one thread. It is in two forums. It is possible someone lives here that may know the answer as I see LUA questions here and that is the problem I am having no? Its not like I have multiple threads spamming the same question all over the place. It is in the two places I frequent for answers as they do not mirror each other.

    This is not the first oUF reference here and considering it is written in LUA and no C# or something I see nothing wrong with asking here.

    I could understand comment and acting like you are helping the moderators had I been saying I have this idea code it for me, but I am trying to figure this out on my own and sharing the knowledge in the process.

    Thank you
    -Nabbs
    Posted in: Lua Code Discussion
  • 0

    posted a message on masking for Health and Power bars
    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
      
    --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
        
    Posted in: Lua Code Discussion
  • 0

    posted a message on masking for Health and Power bars
    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?

    I'm thinking I missed something basic. Like a setting or something I can't find.

    Thanks
    Nabbs



    --// 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  
        
    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)
        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  





    moon is from zorks D3 orbs.



    redid the bars and still no love.

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.