49
edits
No edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
{{widgetmethod}} | {{widgetmethod}} | ||
Moves the frame-based object in relation to where the mouse is being moved. | Moves the frame-based object in relation to where the mouse is being moved. | ||
frame:StartMoving() | frame:StartMoving() | ||
== Details == | == Details == | ||
* Use this with the | * Use this with the {{api|Frame:RegisterForDrag|t=w}}() function and the <OnDragStart>...</OnDragStart> event to allow your frame-based object to be moved by the user. | ||
* Use the | * Use the {{api|Frame:StopMovingOrSizing|t=w}}() function inside the <OnDragStop>...</OnDragStop> XML section to stop the moving process. | ||
* Moving a frame using this function sets the user placed flag for the frame, making the client save its position and reposition the frame on reload. To avoid this behavior, you can call frame:[[API Frame SetUserPlaced|SetUserPlaced]](false) immediately after StopMovingOrSizing(). | * Moving a frame using this function sets the user placed flag for the frame, making the client save its position and reposition the frame on reload. To avoid this behavior, you can call frame:[[API Frame SetUserPlaced|SetUserPlaced]](false) immediately after StopMovingOrSizing(). | ||
*For pixel-precise movements, you should instead use [[API EnableMouse|EnableMouse()]] and the <OnMouseDown>...</OnMouseDown> and <OnMouseUp>...</OnMouseUp> events (and probably also the <OnHide>...</OnHide> event). | *For pixel-precise movements, you should instead use [[API EnableMouse|EnableMouse()]] and the <OnMouseDown>...</OnMouseDown> and <OnMouseUp>...</OnMouseUp> events (and probably also the <OnHide>...</OnHide> event). | ||