This will snap to a 100 X 75 grid anywhere on the card.  It does not restrict
the bounds i.e. left from 50 to 275, but that could be added.

on mouseUp
   put the top of me into tTop
   put the left of me into tLeft
   put round(tTop / 75) * 75 into tNewTop
   put round(tLeft /100) * 100 into tNewLeft
   lock screen
   set the top of me to tNewTop
   set the left of me to tNewLeft
   unlock screen
   put the topLeft of me
end mouseUp

on mouseDown
   grab me
end mouseDown





--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Snapping-To-A-Grid-of-TopLefts-tp4684742p4684744.html
Sent from the Revolution - User mailing list archive at Nabble.com.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to