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

2013/10/26

Greenfoot.mouseClicked bug?

Zamoht Zamoht

2013/10/26

#
I have encountered what seems to be a bug. I know bugs should go to support, but I'm not sure so I'll ask here first. The problem is that the mouseClicked should return true when the mouse is pressed and released on the given object (as it says in the API). Now this works as it should, but if I pass a null point object as argument instead of an Actor I encounter that the method will return true on a simple mouse press. I see that it can be hard to tell if the mouse is pressed and released on the same object if there is not Actor passed, but either this should be changed so it returns true when the mouse is released only (since mousePressed(null) and mouseClicked(null) does the same right now as I see it) or a new mouseReleased method should be implemented (in my opinion). I would like to know if there is a simple workaround or if I should go to the support with the problem.
danpost danpost

2013/10/26

#
Unless you have that method overridden, it should work as documented (I just tested it out and had no problems with it -- it returned true only when the mouse button was released). If you still think there is a problem with it, upload a simple scenario that displays this behavior for us to look at.
Zamoht Zamoht

2013/10/26

#
Oh thank you. There was a bug in my own code if anything, now I feel stupid.
You need to login to post a reply.