Guest User

Untitled

a guest
Feb 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. function MakeUnitFrame(unit)
  2. local rc = CreateFrame("Frame", "MyUnitFrame_"..unit, UIParent, "SecureUnitButtonTemplate")
  3.  
  4.  
  5. rc:SetAttribute("unit", unit)
  6. RegisterUnitWatch(rc)
  7.  
  8. rc:RegisterForClicks("AnyUp")
  9. rc:SetAttribute("alt-type1", "target")
  10.  
  11. rc:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
  12. rc:SetWidth(256)
  13. rc:SetHeight(256)
  14.  
  15. rc.background = rc:CreateTexture(nil, "BACKGROUND")
  16. rc.background:SetPoint("TOPLEFT", rc, "TOPLEFT", 0, 0)
  17. rc.background:SetPoint("BOTTOMLEFT", rc, "BOTTOMLEFT", 0, 0)
  18. rc.background:SetWidth(rc:GetWidth())
  19. rc.background:SetTexture(0, 0, 0, 0.5)
  20. end
Add Comment
Please, Sign In to add comment