Quantcast
WoWInterface - View Single Post - My CombatIndicator spawns "behind" the frame.
View Single Post
05-11-18, 02:04 AM   #1
dzreams
A Defias Bandit
Join Date: Jan 2018
Posts: 2
My CombatIndicator spawns "behind" the frame.

Hello, first of all this project is really quite wonderful, but I'm running into a little issue where my CombatIndicator seems to spawn behind the actual frame:



If you look closely, the indicator is "infront" of the background, but "behind" the health bar - when I remove the statusbar elements this is still the case, so somehow I am drawing my statusbars in front of the indicator. I've tried a few things:
  • Hiding the statusbar backgrounds
  • Giving the statusbar and statusbar.bg different "layers"
  • Different order of things
But haven't got to a nice solution. Anyway, here are the relevant codes:

Code:
  self.Health = createStatusBar(self)
  self.Health:SetPoint("TOPLEFT", self, "TOPLEFT", conf.borderSize, -conf.borderSize)
  self.Health:SetPoint("TOPRIGHT", self, "TOPRIGHT", -conf.borderSize, -conf.borderSize)
  self.Health:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, -healthHeight)
  self.Health:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 0, -healthHeight)
  self.Health.colorSmooth = true
  self.Health.colorClass = true
  self.Health.bg.multiplier = conf.bgMultiplier
Code:
  if unit == "player" then
    self.CombatIndicator = self:CreateTexture(nil, "OVERLAY")
    self.CombatIndicator:SetPoint("CENTER", self, "TOP", 0, 0)
    self.CombatIndicator:SetSize(32, 32)
  end
Code:
local tex = [[Interface\AddOns\bdCore\media\smooth]]
ns.utils.createStatusBar = function (parent)
  local b = CreateFrame("StatusBar", nil, parent)
  b:SetStatusBarTexture(tex, "BORDER")
  b.bg = b:CreateTexture(nil, "BACKGROUND")
  b.bg:SetTexture(tex)
  b.bg:SetAllPoints()
  return b
end
Anyway - any help that you can give me, or hints in the right direction, would be most appreciated.

Thanks
  Reply With Quote