Page 1 of 1

Circle Onclick?

Posted: Tue Jan 14, 2014 7:28 pm
by michielewiel
Well, i have a bit of a problem . I'm gonna make a quick overview of the situation i have an image in the shape of a circle if i click on it i want it to preform an action it's as simple as that. I get how i do it with retangels. But how on earth are you supposed to it with circles. Sorry for the somewhat noobish question i went trough the whole forum but simply couldn't find an awnser maybe an onclick command with a drable would be superhandy. :) thanks in advance micheal

Re: Circle Onclick?

Posted: Tue Jan 14, 2014 7:55 pm
by veethree
You can use a distance function, There's a snippet for one here. I attached an example.

The example uses love.graphics.circle, So the x and y values represent the center of the circle. If you're using an image the x and y would represent the top left corner. keep that in mind.

[]

Posted: Tue Jan 14, 2014 8:29 pm
by bekey
-snip-

Re: Circle Onclick?

Posted: Tue Jan 14, 2014 9:21 pm
by michielewiel
Wow thanks guys it worked perfectly thanks ^^