WoW:API Frame StartMoving: Difference between revisions

no edit summary
(marginally closer to bp, setuserplaced note)
No edit summary
Line 9: Line 9:
*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).
*If the frame becomes stuck by any cause (see [[API SetClampedToScreen|SetClampedToScreen()]]), the mouse and the frame will go out-of-sync.
*If the frame becomes stuck by any cause (see [[API SetClampedToScreen|SetClampedToScreen()]]), the mouse and the frame will go out-of-sync.
*If you use the StartDrag/StopDrag events to initiate the dragging, be sure not to :Hide() the dragged frames during the process. A hidden frame will NOT receive its StopDrag event.
*This function together with [[API StopMovingOrSizing|StopMovingOrSizing()]] exhibit some "special" behavior that can cause problems when used with frames that are not anchored to UIParent (or some other full-screen frame).
*This function together with [[API StopMovingOrSizing|StopMovingOrSizing()]] exhibit some "special" behavior that can cause problems when used with frames that are not anchored to UIParent (or some other full-screen frame).
**Immediately upon calling StartMoving(), the frame will be de-anchored from any other frame it was previously anchored to, and instead anchored to the screen.  For example, if MyFrame's TOPLEFT is anchored to MyParent's TOPLEFT at (5,-5), and MyParent's TOPLEFT is anchored to UIParent's TOPLEFT at (100,-100), then MyFrame:StartMoving() immediately re-anchors MyFrame's TOPLEFT to the screen's (nil anchor) TOPLEFT at (105,-105).  The original anchor frame (MyParent) and offset will not be restored by [[API StopMovingOrSizing|StopMovingOrSizing()]].
**Immediately upon calling StartMoving(), the frame will be de-anchored from any other frame it was previously anchored to, and instead anchored to the screen.  For example, if MyFrame's TOPLEFT is anchored to MyParent's TOPLEFT at (5,-5), and MyParent's TOPLEFT is anchored to UIParent's TOPLEFT at (100,-100), then MyFrame:StartMoving() immediately re-anchors MyFrame's TOPLEFT to the screen's (nil anchor) TOPLEFT at (105,-105).  The original anchor frame (MyParent) and offset will not be restored by [[API StopMovingOrSizing|StopMovingOrSizing()]].
Anonymous user