Now that I am working on Groove Blox, I need to implement a snap to grid system.
I am also utilizing tracks. I need to figure out how to add/delete tracks (right now, I am using a data grid - in form mode - have a check box and everything that would constitute a track grouped). I assume I just copy the group and delete the selected tracks? Each track needs to be a audio player so it can play back the groove blox.
So, the user will drag and drop a colored rectangle (that also needs to be figured out) into the track in question and I need the rectangle to SNAP to the previous rectangle, if any. If none exist, then it snaps to a placeholder rectangle I put in there. I will eventually hide the placeholder rectangle so all you see are the blocks.
How would I go about setting up the snap to grid?
Mike
snap to grid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: snap to grid
Hi Mike,
try this as one way of doing some sort of 'snap' in a button script. Obviously this could be adapted to a different location.
Kind regards
Bernd
try this as one way of doing some sort of 'snap' in a button script. Obviously this could be adapted to a different location.
Code: Select all
on mouseDown
grab me
end mouseDown
on mouseUp
set the left of me to item 1 of the loc of this card
end mouseUp
on mouseRelease
mouseUp
end mouseRelease
Bernd
Re: snap to grid
Close.
I only want to grab ONE copy and have the user drag and drop it into place - into place means on one of the tracks. It should SNAP into place to the left of the previous block (unless there are no blocks. I can make a line to snap to so there is something to the left of the snap point.
Mike
I only want to grab ONE copy and have the user drag and drop it into place - into place means on one of the tracks. It should SNAP into place to the left of the previous block (unless there are no blocks. I can make a line to snap to so there is something to the left of the snap point.
Mike