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

2012/6/11

Getting Screen X and Y Location of the Greenfoot simulation

USBest USBest

2012/6/11

#
How can I get the X and Y Location of the window, my simulation is played in?
ttamasu ttamasu

2012/6/11

#
If you are using any object that is subclass of Actor just use getX() and getY() methods
USBest USBest

2012/6/12

#
Well... I don't know, if the window is a subclass of Actor... And how can you get the window as an Object?
davmac davmac

2012/6/12

#
I assume you want the on-screen co-ordinates. There's no supported way of doing this. What is your intention - that is, why do you want to know the location of the window?
USBest USBest

2012/6/12

#
I want to set the location of the mouse at a startpoint. I already tried with:
                new Robot().mouseMove(getStartPoint().getX(),getStartPoint().getY());
But this just setts the location on the computer screen... the method getStartPoint() returns an Object that is a subclass of Actor
You need to login to post a reply.