WoW:API Region SetAllPoints: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Formatting)
mNo edit summary
Line 3: Line 3:
Sets an object to be positioned and sized exactly the same as another object.
Sets an object to be positioned and sized exactly the same as another object.


  MyObject:SetAllPoints(frame or "frameName")  
  MyObject:SetAllPoints(relativeRegion or "regionName")  


... is exactly equivalent to:
... is exactly equivalent to:


  MyObject:SetPoint("TOPLEFT",frame ,"TOPLEFT",0,0)
  MyObject:SetPoint("TOPLEFT", relativeRegion ,"TOPLEFT", 0, 0)
  MyObject:SetPoint("TOPRIGHT",frame ,"TOPRIGHT",0,0)
  MyObject:SetPoint("TOPRIGHT", relativeRegion ,"TOPRIGHT", 0, 0)
  MyObject:SetPoint("BOTTOMLEFT",frame ,"BOTTOMLEFT",0,0)
  MyObject:SetPoint("BOTTOMLEFT", relativeRegion ,"BOTTOMLEFT", 0, 0)
  MyObject:SetPoint("BOTTOMRIGHT",frame ,"BOTTOMRIGHT",0,0)
  MyObject:SetPoint("BOTTOMRIGHT", relativeRegion ,"BOTTOMRIGHT", 0, 0)


* See [[API Region SetPoint|Region:SetPoint]]()
* See [[API Region SetPoint|Region:SetPoint]]()
* ''frame'' may be given as nil to anchor relative to the whole screen.
* ''region'' may be given as nil to anchor relative to the whole screen. {What if the region isn't specified, does it default to parent or screen or error?)

Revision as of 00:05, 14 May 2007

Widget API ← Region < SetAllPoints

Sets an object to be positioned and sized exactly the same as another object.

MyObject:SetAllPoints(relativeRegion or "regionName") 

... is exactly equivalent to:

MyObject:SetPoint("TOPLEFT", relativeRegion ,"TOPLEFT", 0, 0)
MyObject:SetPoint("TOPRIGHT", relativeRegion ,"TOPRIGHT", 0, 0)
MyObject:SetPoint("BOTTOMLEFT", relativeRegion ,"BOTTOMLEFT", 0, 0)
MyObject:SetPoint("BOTTOMRIGHT", relativeRegion ,"BOTTOMRIGHT", 0, 0)
  • See Region:SetPoint()
  • region may be given as nil to anchor relative to the whole screen. {What if the region isn't specified, does it default to parent or screen or error?)