Quantcast
WoWInterface - View Single Post - How to use LineMixin?
View Single Post
05-02-18, 12:46 PM   #1
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 65
How to use LineMixin?

Does anyone know how to use the LineMixin? I tried messing around with it but I'm not sure how to properly mix it with a texture.

Lua Code:
  1. -- Mix this into a Texture to be able to treat it like a line
  2. LineMixin = {};
  3.  
  4. function LineMixin:SetStartPoint(x, y)
  5.     self.startX, self.startY = x, y;
  6. end
  7.  
  8. function LineMixin:SetEndPoint(x, y)
  9.     self.endX, self.endY = x, y;
  10. end
  11.  
  12. function LineMixin:SetThickness(thickness)
  13.     self.thickness = thickness;
  14. end
  15.  
  16. function LineMixin:Draw()
  17.     local parent = self:GetParent();
  18.     local x, y = parent:GetLeft(), parent:GetBottom();
  19.  
  20.     self:ClearAllPoints();
  21.     DrawLine(self, parent, self.startX - x, self.startY - y, self.endX - x, self.endY - y, self.thickness or 32, 1);
  22. end
__________________
Thomas aka Urnn
  Reply With Quote