Discuss Scratch

cowper-jt
Scratcher
3 posts

Toggle Prevent Dragging During Play

Hi all,

I'm looking for a way to allow my sprite to be dragged to one of three certain spots on my screen, and then have it so that once it gets dragged to that one of these spots, it is prevented from being dragged anywhere else. I'm aware that I can use the “can drag in player” check box in the sprite's properties to allow or disallow dragging ALL THE TIME, but I'm looking for a way to, as I said, disable dragging once it gets to that spot. I've tried to have a look through all the blocks but nothing seems to look like a block to turn dragging on and off.

Is there a block like show/hide, maybe draggable/not-draggable that I'm missing, or is there a workaround to achieve this toggle of dragging DURING gameplay?

Thanks in advance for any help.

Last edited by cowper-jt (Oct. 11, 2013 02:09:26)

scubajerry
Scratcher
1000+ posts

Toggle Prevent Dragging During Play

Make it not draggable
You have to make your own drag and drop script.
when GF clicked
Set [draggable v] to (1)

when this sprite clicked
if <(draggable) = (1)> then
repeat until <not(mouse down ?)>
go to [mouse_pointer v]
end
end
Set [draggable v] to (0)
Determine if this is one of the places it can be dropped.

Last edited by scubajerry (Oct. 11, 2013 02:42:14)

cowper-jt
Scratcher
3 posts

Toggle Prevent Dragging During Play

Thank you so much! That'll work perfectly.

Powered by DjangoBB