Grid and Grab . . .
FlexibleLearning at aol.com
FlexibleLearning at aol.com
Thu Jun 10 14:33:20 EDT 2004
An alternative from The Scripter's Scrapbook...
on mouseDown
put "10" into tGridSize # Adjust as you wish
repeat until the mouse is up
if the shiftKey="down" then
set the loc of the target to snapLoc(the mouseLoc,tGridSize)
else set the loc of the target to the mouseLoc
end repeat
end mouseDown
function snapLoc ml,n
put round((item 1 of ml/n))*n into a
put round((item 2 of ml/n))*n into b
return a&","&b
end snapLoc
/H
_________________________________________________
Hugh Senior
The Flexible Learning Company
Consultant Programming & Software Solutions
Fax/Voice: +44 (0)1483.27 87 27
Email: _mailto:h at flexibleLearning.com_ (mailto:admin at flexibleLearning.com)
Web: _www.flexibleLearning.com_ (http://www.flexiblelearning.com/)
More information about the use-livecode
mailing list