It looks like you're new here. If you want to get involved, click one of these buttons!
Circle = Core.class(Shape) function Circle:init(x, y, radius) local sides=math.floor(radius/2) local angleStep=360/sides --self:setFillStyle(Shape.SOLID, 0xff0000, 1) self:setLineStyle(1, 0xff0000, 0.8) self:beginPath() self:moveTo(radius, 0) for i = 1,sides do local angle = math.rad(i*angleStep) xx = math.cos(angle)*radius yy = math.sin(angle)*radius self:lineTo(xx,yy) end self:endPath() self:setPosition(x,y) end |
Likes: totebo, simwhi, SinisterSoft
Comments
Here's a function to test if a given x,y position is inside a circle..
Likes: rolfpancake, SinisterSoft
Likes: antix, Cesar, rolfpancake, SinisterSoft
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://giderosmobile.com/forum/discussion/3595/non-rectangle-button/p1
Likes: Cesar
Likes: antix
Likes: rolfpancake
Likes: antix
https://deluxepixel.com
@SinisterSoft, you are most likely right. Hmm, I have MANY things to change in my codebase
Likes: SinisterSoft
https://deluxepixel.com
I've used the method in the past, and probably it's not the most effective solution but it worked
Something like this :
Likes: antix