how to detect clicks on Drawable images?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
vschiavoni
Prole
Posts: 6
Joined: Tue Jul 06, 2010 1:32 pm

how to detect clicks on Drawable images?

Post 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 ?..
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: how to detect clicks on Drawable images?

Post 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
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 201 guests