View Single Post
09-05-14, 03:46 PM   #5
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Smile

I did this the other day too, you actually have to create a new texture correctly sized and parented to PlayerFrameBackground rather than modifying the frame itself - else, as you've noticed, the entire unit background is recoloured.



Lua Code:
  1. --
  2.     if PlayerFrame:IsShown() and not bg then
  3.         local _, class = UnitClass("player")
  4.         local colour = RAID_CLASS_COLORS[class]
  5.         local bg = PlayerFrame:CreateTexture(nil, "ARTWORK")
  6.            
  7.         bg:SetPoint("TOPLEFT", PlayerFrameBackground)
  8.         bg:SetPoint("BOTTOMRIGHT", PlayerFrameBackground, 0, 22)
  9.         bg:SetVertexColor(colour.r, colour.g, colour.b, .95)
  10.         bg:SetTexture("texturepath")
  11.     end

Last edited by ObbleYeah : 09-05-14 at 03:49 PM.
  Reply With Quote