This site requires JavaScript, please enable it in your browser!
Greenfoot back
meir
meir wrote ...

2012/6/17

Press object and prevent movement

meir meir

2012/6/17

#
Hi, There are two things that I am trying to do, and I am stuck for the both of them. Is there any way to prevent an object from being moved (dragged)? Is there a way to trigger a function when I drag an object in the world and then drop it (like a blur, and focus)? Thanks
danpost danpost

2012/6/17

#
meir wrote...
Is there any way to prevent an object from being moved (dragged)?
While the simulation is running, an object cannot be dragged, unless you allowed it programatically using 'mousePressed', 'mouseDragged', and 'mouseDragEnded'.
meir wrote...
Is there a way to trigger a function when I drag an object in the world and then drop it (like a blur, and focus)?
'mousePressed' and 'mouseDragEnded' are perfect times to change the image how you please.
You need to login to post a reply.