Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-06-14, 07:20 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If this is your own layout, why are you creating a separate function to put a backdrop on the raid target icon? Just add the backdrop in the same place you create the icon in the first place.

Also, you can't parent a frame to a texture, and the second argument to CreateFrame must be either a string or nil (and for something like this should be nil), one of which is why you're getting that error.

Code:
local iconFrame = CreateFrame("Frame", nil, f)
iconFrame:SetPoint("RIGHT", 5, 0)
iconFrame:SetSize(24, 24)

iconFrame:SetBackdrop({
     bgFile = "Interface\\BUTTONS\\WHITE8x8", tile = true, tileSize = 8,
     edgeFile = "Interface\\BUTTONS\\WHITE8x8", edgeSize = 1,
     insets = { left = 1, right = 1, top = 1, bottom = 1 }
})
iconFrame:SetBackdropColor(0, 0, 0, 0.5)
iconFrame:SetBackdropBorderColor(0, 0, 0, 1)

local icon = iconFrame:CreateTexture(nil, "ARTWORK")
icon:SetAllPoints(true)
icon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons")
iconFrame.icon = icon

iconFrame.Override = function(self, event)
     local index = GetRaidTargetIndex(self.unit)
     if index then
          SetRaidTargetIconTexture(self.RaidIcon.icon, index)
          self.RaidIcon:Show()
     else
          self.RaidIcon:Hide()
     end
end

f.RaidIcon = iconFrame
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Create a Border for RaidTargetIcons


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