Share some of your most useful scripts! You could help somebody out!
In case you want to drag and drop sprites onscreen, here is the script:
<when[ Whatever ]clicked>
<repeat until><< <not> <mouse down?> >>
<go to x <mouse x> )y <mouse y>
<end>
Note: It is drag and drop, so you will have to keep holding the mouse.
Offline
The only problem with that code is that if you have more than one object that can be dragged and dropped, they can all stick to the mouse at the same time.
The best way around this is to use a variable "dragging" which is set to 1 when you are dragging something. Objects to be dragged should then be set to only be dragged if "dragging" = 0.
*****
Alternatively, just use the little padlock symbol in the sprite title block, to set it as draggable
Last edited by Mayhem (2008-11-30 12:49:28)
Offline