That is a bit of a separate issue. I'm not trying to replace minimap blips or anything along those lines, I'm just trying to easily get part of that texture using SetTexCoords depending on a units class, right now I have to do something along the lines of
Code:
-- Setup raid/party icons similar too the minimap
local icon = [[Interface\MINIMAP\PartyRaidBlips]]
local classIndex = {
WARRIOR = {0, .125, .5, .75},
PALADIN = {.125, .25, .5, .75},
HUNTER = {.25, .375, .5, .75},
ROGUE = {.375, .5, .5, .75},
PRIEST = {.5, .625, .5, .75},
DEATH_KNIGHT = {.625, .75, .5, .75},
SHAMAN = {.75, .875, .5, .75},
MAGE = {.875, 1, .5, .75},
WARLOCK = {0, .125, .75, 1},
DRUID = {.25, .375, .75, 1},
}
function module:setIconTexture(blip)
if not UnitExists(blip.unit) then return end
local l, r, t, b = unpack(classIndex[select(2, UnitClass(blip.unit))])
blip.icon:SetTexture(icon)
if UnitInParty(blip.unit) then
blip.icon:SetTexCoord(l, r, t - .5, b - .5)
else
blip.icon:SetTexCoord(l, r, t, b)
end
end
but I would like to have a function that I just give the units class too and it handles the cropping for me. I figured blizzard might have had one because of the minimap but I don't know.
It would be similar to blizzards function
Code:
SetRaidTargetIconTexture(icon, index)