G’day,
I find the way that lines are positioned to be confusing. After you use display.newLine to create the line object, Corona sets the object x,y position to be the first point on the line. I would have expected instead that x,y would be relative to the points you’ve defined.
For example, the following lines will appear on screen directly on top of each other:
line1 = display.newLine(0,0, 100,100) line1.x, line1.y = 100, 100 line2 = display.newLine(-50,-50, 50,50) line2.x, line2.y = 100, 100
Line1 appears where I’d have expected, but I would have thought that line2 would be drawn centred around the x,y origin.
The behaviour of Corona in automatically realigning your shapes after you’ve drawn them (which it also does with polygons), actually makes things harder, as you have to work out how to re-realign the shape back to where you actually wanted it.
I think there should be a note in the manual for display.newLine to describe this behaviour.
Am I understanding this correctly?
Cheers,
Warwick