类型 函数 库 display.* 返回值 LineObject 修订 版本 2024.3703 关键字 线条、向量 另请参见 object:setStrokeColor() object.strokeWidth object:append()
从一个点绘制一条线到另一点。另外,您还可以将点附加到线的末尾以创建轮廓形状或路径。
目前,display.newLine()
对象不支持 触摸/轻触 事件。
display.newLine( [parent,] x1, y1, x2, y2 [, x3, y3, ... ] )
GroupObject. 用于插入线的可选显示组。
数字. 线起点坐标。
数字. 线终点坐标。
数字. 其他坐标。
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