display.newLine?

Hi, is there any code can draw lines in corona sdk?
using coordinates like (x1,y1,x2,y2)?

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! :) ), 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

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.

workaround for x1,y1,x2,y2 is here

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?

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

C.

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

:)

views:2140 update:2011/9/18 20:20:08
corona forums © 2003-2011