Circle Onclick?

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
michielewiel
Prole
Posts: 3
Joined: Tue Aug 20, 2013 7:50 am

Circle Onclick?

Post 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
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

Re: Circle Onclick?

Post 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.
Attachments
circle.love
(438 Bytes) Downloaded 144 times
bekey
Party member
Posts: 255
Joined: Tue Sep 03, 2013 6:27 pm

[]

Post by bekey »

-snip-
Last edited by bekey on Fri Jan 24, 2014 2:20 am, edited 3 times in total.
michielewiel
Prole
Posts: 3
Joined: Tue Aug 20, 2013 7:50 am

Re: Circle Onclick?

Post by michielewiel »

Wow thanks guys it worked perfectly thanks ^^
Post Reply

Who is online

Users browsing this forum: No registered users and 164 guests