Page 1 of 1

how to detect clicks on Drawable images?

Posted: Thu Jul 08, 2010 9:04 am
by vschiavoni
Hello,
what is the common way to detect clicks on some Drawable object and attach events to it?
Do I need to get the coordinates of the mouse, see if some of the drawn objects are captured by them, discover which one is the foreground, and do something ?..

Re: how to detect clicks on Drawable images?

Posted: Thu Jul 08, 2010 9:38 am
by nevon
There's no cookie-cutter method to check whether or not you have clicked on an image - since it's only a graphic, not necessarily a game object. In other words, you need to write your own methods to do all that.

I had a similar problem some time ago. You can see the available solutions here: viewtopic.php?f=3&t=1502