Guest User

Untitled

a guest
May 26th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. -- Position and size
  2. local Castbar = CreateFrame("StatusBar", nil, self)
  3. Castbar:SetSize(20, 20)
  4. Castbar:SetPoint('TOP')
  5. Castbar:SetPoint('LEFT')
  6. Castbar:SetPoint('RIGHT')
  7.  
  8. -- Add a background
  9. local Background = Castbar:CreateTexture(nil, 'BACKGROUND')
  10. Background:SetAllPoints(Castbar)
  11. Background:SetTexture(1, 1, 1, .5)
  12.  
  13. -- Add a spark
  14. local Spark = Castbar:CreateTexture(nil, "OVERLAY")
  15. Spark:SetSize(20, 20)
  16. Spark:SetBlendMode("ADD")
  17.  
  18. -- Add a timer
  19. local Time = Castbar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
  20. Time:SetPoint("RIGHT", Castbar)
  21.  
  22. -- Add spell text
  23. local Text = Castbar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
  24. Text:SetPoint("LEFT", Castbar)
  25.  
  26. -- Add spell icon
  27. local Icon = Castbar:CreateTexture(nil, "OVERLAY")
  28. Icon:SetSize(20, 20)
  29. Icon:SetPoint("TOPLEFT", Castbar, "TOPLEFT")
  30.  
  31. -- Add Shield
  32. local Shield = Castbar:CreateTexture(nil, "OVERLAY")
  33. Shield:SetSize(20, 20)
  34. Shield:SetPoint("CENTER", Castbar)
  35.  
  36. -- Add safezone
  37. local SafeZone = Castbar:CreateTexture(nil, "OVERLAY")
  38.  
  39. -- Register it with oUF
  40. self.Castbar = Castbar
  41. self.Castbar.bg = Background
  42. self.Castbar.Spark = Spark
  43. self.Castbar.Time = Time
  44. self.Castbar.Text = Text
  45. self.Castbar.Icon = Icon
  46. self.Castbar.SafeZone = SafeZone
Add Comment
Please, Sign In to add comment