home *** CD-ROM | disk | FTP | other *** search
- on dragBlock direction, clickPt
- global originPt
- if clickPt = [] then
- set origMouse to point(the mouseH, the mouseV)
- else
- set origMouse to clickPt
- end if
- set calcH to the left of sprite the clickOn + ((the right of sprite the clickOn - the left of sprite the clickOn) / 2)
- set calcV to the top of sprite the clickOn + ((the bottom of sprite the clickOn - the top of sprite the clickOn) / 2)
- set origMouse to point(calcH, calcV)
- repeat while the mouseDown
- updateCursor()
- set diffMouse to point(the mouseH, the mouseV) - origMouse
- if direction = 1 then
- set the locH of sprite the clickOn to getAt(originPt, 1) + getAt(diffMouse, 1)
- next repeat
- end if
- if direction = 2 then
- set the locV of sprite the clickOn to getAt(originPt, 2) + getAt(diffMouse, 2)
- next repeat
- end if
- if direction = 3 then
- set the locH of sprite the clickOn to getAt(originPt, 1) + getAt(diffMouse, 1)
- set the locV of sprite the clickOn to getAt(originPt, 2) + getAt(diffMouse, 1)
- next repeat
- end if
- if direction = 4 then
- set the locH of sprite the clickOn to getAt(originPt, 1) + getAt(diffMouse, 1)
- set the locV of sprite the clickOn to getAt(originPt, 2) - getAt(diffMouse, 1)
- end if
- end repeat
- updateCursor()
- end
-