Mercurial > wow > raid-target-tactics
comparison 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 |
comparison
equal
deleted
inserted
replaced
9:7201711b23e9 | 10:f93b554bb7cf |
---|---|
1 | |
2 local RaidIcon = class() | |
3 local _G = _G | |
4 | |
5 function RaidIcon:init(num) | |
6 self.num = num | |
7 end | |
8 | |
9 function RaidIcon:draw(parent, x, y) | |
10 local frame = CreateFrame("Frame", nil, parent) | |
11 frame:SetWidth(16) | |
12 frame:SetHeight(16) | |
13 frame:SetPoint("TOPLEFT", x, y) | |
14 local tex = frame:CreateTexture(nil, "ARTWORK") | |
15 tex:SetAllPoints(frame) | |
16 tex:SetTexture("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcon_" .. self.num) | |
17 frame:Show() | |
18 return frame | |
19 end | |
20 | |
21 _G.RaidIcons = {} | |
22 _G.RaidIcons[1] = RaidIcon("1") | |
23 _G.RaidIcons[2] = RaidIcon("2") | |
24 _G.RaidIcons[3] = RaidIcon("3") | |
25 _G.RaidIcons[4] = RaidIcon("4") | |
26 _G.RaidIcons[5] = RaidIcon("5") | |
27 _G.RaidIcons[6] = RaidIcon("6") | |
28 _G.RaidIcons[7] = RaidIcon("7") | |
29 _G.RaidIcons[8] = RaidIcon("8") | |
30 |