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

2013/11/23

Change Mouse Location?

shrucis1 shrucis1

2013/11/23

#
I understand Greenfoot comes with support for creating MouseInfo objects, from which you can get the mouse's current position, etc. However, is it possible in Greenfoot to force the mouse to stay at the center of the screen? I would like to use this for a scenario where you try to move the mouse, a certain action happens in-game and the mouse is forced back to the center so you can move it again. Thanks!
erdelf erdelf

2013/11/23

#
i think the robot class should have what u need
bourne bourne

2013/11/23

#
I made a demo here: (does not work on site because security, playing with the mouse can be used mischievously) http://www.greenfoot.org/scenarios/10066
shrucis1 shrucis1

2013/11/23

#
Thanks guys! This really helps me out!
You need to login to post a reply.