WoW:Making Draggable Frames: Difference between revisions

m
→‎Using OnMouseDown / OnMouseUp: Code correction; see talk page
(→‎Using TitleRegion: Invalid XML)
m (→‎Using OnMouseDown / OnMouseUp: Code correction; see talk page)
Line 100: Line 100:
  frame:SetMovable(true)
  frame:SetMovable(true)
  frame:EnableMouse(true)
  frame:EnableMouse(true)
  frame:SetScript("OnMouseDown", function(self)
  frame:SetScript("OnMouseDown", function(self, button)
   if button == "LeftButton" and not self.isMoving then
   if button == "LeftButton" and not self.isMoving then
     self:StartMoving();
     self:StartMoving();
Line 106: Line 106:
   end
   end
  end)
  end)
  frame:SetScript("OnMouseUp", function(self)
  frame:SetScript("OnMouseUp", function(self, button)
   if button == "LeftButton" and self.isMoving then
   if button == "LeftButton" and self.isMoving then
     self:StopMovingOrSizing();
     self:StopMovingOrSizing();
Line 123: Line 123:
  tex:SetAllPoints();
  tex:SetAllPoints();
  tex:SetTexture(1.0, 0.5, 0); tex:SetAlpha(0.5);
  tex:SetTexture(1.0, 0.5, 0); tex:SetAlpha(0.5);


==General Notes==
==General Notes==
Anonymous user