display.newLine?

Hi, is there any code can draw lines in corona sdk?
using coordinates like (x1,y1,x2,y2)? [import]uid: 4992 topic_id: 714 reply_id: 300714[/import]

Not through the SDK directly (I think someone from Ansca said it was being worked on for a future version… boy it sure would be nice to see a roadmap split up by projected releases and projected timeframes! :slight_smile: ), but garysims posted some code which should do the trick (no idea on performance):

http://developer.anscamobile.com/forum/2010/02/19/bresenhams-line-algorithm

Scott [import]uid: 5659 topic_id: 714 reply_id: 1423[/import]

You can use display.newRect(x, y, 1, ySize) for a a vertical line. Just used this in one of my projects, it’s basically a rectangle with one dimension stripped down to 1. [import]uid: 87 topic_id: 714 reply_id: 1427[/import]

workaround for x1,y1,x2,y2 is here [import]uid: 6050 topic_id: 714 reply_id: 1757[/import]

Hello,

I need to create a polylines object which is closed and filled with a color. An object like a silhouette.
Any idea for a workaround?
[import]uid: 8285 topic_id: 714 reply_id: 13878[/import]

See the bezier sample code I just posted … we have had a new display.newLIne feature for sometime.

C. [import]uid: 24 topic_id: 714 reply_id: 13894[/import]

Thank you Carlos. Sounds good. I’ll give it a try.

:slight_smile: [import]uid: 8285 topic_id: 714 reply_id: 13975[/import]