View Single Post
08-08-14, 10:06 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
There's nothing in your code that would save or restore a position.

The simplest method would be to let the game handle it:
Code:
anchor:RegisterForDrag("LeftButton")
anchor:SetMovable(true)
anchor:SetUserPlaced(true)
anchor:SetScript("OnDragStart", anchor.StartMoving)
anchor:SetScript("OnDragStop", anchor.StopMovingOrSizing)
Or, if you want to do it yourself, then you need to save the position into your saved variables table in your OnDragStop script, and restore it when your addon loads.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote