Type Function Library display.* Return value LineObject Revision Release 2022.3683 Keywords lines, vector See also object:setStrokeColor() object.strokeWidth object:append()
Draw a line from one point to another. Optionally, you may append points to the end of the line to create outline shapes or paths.
Currently, display.newLine()
objects do not support touch/tap events.
display.newLine( [parent,] x1, y1, x2, y2 [, x3, y3, ... ] )
GroupObject. An optional display group in which to insert the line.
Numbers. Coordinates of the beginning of the line.
Numbers. Coordinates of the end of the line.
Numbers. Additional coordinates.
local star = display.newLine( 200, 90, 227, 165 ) star:append( 305,165, 243,216, 265,290, 200,245, 135,290, 157,215, 95,165, 173,165, 200,90 ) star:setStrokeColor( 1, 0, 0, 1 ) star.strokeWidth = 8