view Icon.lua @ 10:f93b554bb7cf

class implementation, Icon class for Raid Target Icons
author Jay Bird <a4blank@yahoo.com>
date Sun, 28 Nov 2010 18:59:31 +0300
parents
children d2cbfe498c4d
line wrap: on
line source

local RaidIcon = class()
local _G = _G

function RaidIcon:init(num)
    self.num = num
end

function RaidIcon:draw(parent, x, y)
    local frame = CreateFrame("Frame", nil, parent)
    frame:SetWidth(16)
    frame:SetHeight(16)
    frame:SetPoint("TOPLEFT", x, y)
    local tex = frame:CreateTexture(nil, "ARTWORK")
    tex:SetAllPoints(frame)
    tex:SetTexture("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_" .. self.num)
    frame:Show()
    return frame
end

_G.RaidIcons = {}
_G.RaidIcons[1] = RaidIcon("1")
_G.RaidIcons[2] = RaidIcon("2")
_G.RaidIcons[3] = RaidIcon("3")
_G.RaidIcons[4] = RaidIcon("4")
_G.RaidIcons[5] = RaidIcon("5")
_G.RaidIcons[6] = RaidIcon("6")
_G.RaidIcons[7] = RaidIcon("7")
_G.RaidIcons[8] = RaidIcon("8")