How to Draw an Arc , With only border detectable. Or How to Draw curved Lines

Hey Gamers , Please let me know how to draw a curved line or an arc which is hollow in nature. 

I Just want the border to be detectable. 

Please help me out. 

Thanks :-) 

  1. You can probably use this module (haven’t tested for a while) to draw an arc:

http://github.com/roaminggamer/SSKCorona/blob/master/ssk_non_junction/com/roaminggamer/ssk/display/arcs.lua

  1. detectable?  Are you talking about adding a body to the arc? If so, can’t help you with that.

Thanks for reply. By Detectable , I mean that I want the collision of other object to be detected only by outlined region and not the open area of arc. 

A “detectable” physics body must be one of the supported physics body types as defined in the physics.addBody documentation. The easiest two ways to create an arc are to create a polyline (using display.newLine) or to create a polygon where the fill has an alpha and only the stroke is displayed. In both cases, you will need a library like the one Ed (@roaminggamer) has linked to to generate the vertices. You can then use the vertices to create an “edge” physics body. The caveat here is that “edge” physics bodies are limited to just 32 vertices. You will likely, therefore, need to create two sets of vertices, one with lots of points to draw the line/arc, and another set with just 32 points to use to create the physics body.

https://docs.coronalabs.com/api/library/physics/addBody.html

Edge shape (chain) bodies can be defined via a chain array. 

Edge Shape (Chain) Body
chain

Array. An array of vertices to define the edge shape. Up to 32 vertices can be declared. Edge shapes are not restricted to convex angles like polygonal bodies.

connectFirstAndLastChainVertex (optional)

Boolean. If set to true, the first and last vertices will be joined by a straight line. If set to false (default), the edge shape will have disconnected ends.

Hi, I’d to use circle shapes for which only the stroke/border was physics object. I achieved this with a third-party program called: PhysicsEditor

This allows you to create circle shapes with holes in it!

I think @jerejigga has it.  An edge shape chain created using the arc elements  from the module I shared should do the trick.

Just use the verticies (line end-points) from the arc and ensure it never has more than 32 segments.  Boom!  

I gotta try this now…  On the list.

PhysicsEditor worked.Thankyou so much @

bramvbilsen   

But all are paid. Do you know any free Physics Editor?

Their is a plugin for that :slight_smile:

https://store.coronalabs.com/plugin/physics-body-editor

edit: yes it is free

edit2: it use a free application called physics body editor

Hi, like scott said there is a free program. But I have never used it, so I really can’t help with that :slight_smile:
But, and someone please correct me if I’m wrong. Doesn’t the beta GUI editor have a physics editor?

Corona editor has a physics editor. It is only mac and only supports 8 point

You have to decide, is a little money worth your time and the ability to proceed?  Pay the money, support someone in the industry.

If you have trouble downloading the editor you can get them from here. I course do not own them all credit goes to the orginal owner. The only reason I am sharing is because the Mac version is hard to intall and I found a dmg version a while back. https://www.dropbox.com/sh/65byude9cuawb7z/AABSuBfuxtW7rlySo1hEsHwKa?dl=0

  1. You can probably use this module (haven’t tested for a while) to draw an arc:

http://github.com/roaminggamer/SSKCorona/blob/master/ssk_non_junction/com/roaminggamer/ssk/display/arcs.lua

  1. detectable?  Are you talking about adding a body to the arc? If so, can’t help you with that.

Thanks for reply. By Detectable , I mean that I want the collision of other object to be detected only by outlined region and not the open area of arc. 

A “detectable” physics body must be one of the supported physics body types as defined in the physics.addBody documentation. The easiest two ways to create an arc are to create a polyline (using display.newLine) or to create a polygon where the fill has an alpha and only the stroke is displayed. In both cases, you will need a library like the one Ed (@roaminggamer) has linked to to generate the vertices. You can then use the vertices to create an “edge” physics body. The caveat here is that “edge” physics bodies are limited to just 32 vertices. You will likely, therefore, need to create two sets of vertices, one with lots of points to draw the line/arc, and another set with just 32 points to use to create the physics body.

https://docs.coronalabs.com/api/library/physics/addBody.html

Edge shape (chain) bodies can be defined via a chain array. 

Edge Shape (Chain) Body
chain

Array. An array of vertices to define the edge shape. Up to 32 vertices can be declared. Edge shapes are not restricted to convex angles like polygonal bodies.

connectFirstAndLastChainVertex (optional)

Boolean. If set to true, the first and last vertices will be joined by a straight line. If set to false (default), the edge shape will have disconnected ends.

Hi, I’d to use circle shapes for which only the stroke/border was physics object. I achieved this with a third-party program called: PhysicsEditor

This allows you to create circle shapes with holes in it!

I think @jerejigga has it.  An edge shape chain created using the arc elements  from the module I shared should do the trick.

Just use the verticies (line end-points) from the arc and ensure it never has more than 32 segments.  Boom!  

I gotta try this now…  On the list.

PhysicsEditor worked.Thankyou so much @

bramvbilsen   

But all are paid. Do you know any free Physics Editor?

Their is a plugin for that :slight_smile:

https://store.coronalabs.com/plugin/physics-body-editor

edit: yes it is free

edit2: it use a free application called physics body editor

Hi, like scott said there is a free program. But I have never used it, so I really can’t help with that :slight_smile:
But, and someone please correct me if I’m wrong. Doesn’t the beta GUI editor have a physics editor?