View Single Post
10-21-10, 02:26 PM   #5
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
to reset the position upon logout/login

myButton:SetUserPlaced(false)
http://www.wowwiki.com/API_Frame_SetUserPlaced

to reset mid game just call your command like

myButton:ClearAllPoints()
myButton:SetPoint("CENTER", xOffset, yOffset)


now, if you only have one point set, the ClearAllPoints() isnt necessary like in your case, as we only set the topright point.

SetPoint takes 5 parameters.
(point, referenceFrame, referencePoint, offX, offY)

if you only have 3 params like my example, the point and referencePoint will the the same, and the referenceFrame will default as the parent frame, which is the world map frame in this case.

also its good to note that you can also just have one param like so

:SetPoint("CENTER") and that implies an offset of 0,0 but just know, that if you do :SetPoint("CENTER", -217) that you have to include the y offset too. or the bbutton wont show. its either 1 param, 3 params, or 5 params.


edit::
oh, a good place to add the reset command might be
WorldMapFrame:HookScript("OnShow", function() resetPos() end)
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote