The docs say, in regards to polygons:
Array. An array of x,y coordinates. These coordinates will automatically be re-centered about the center of the polygon.
The code below I would expect to create a grey arrow extending down from the base of a white box, since the 2 vertices for the base of the box match the two at the top of the arrow.
Instead, via this re-centering the arrow has been moved upwards and the shared edges don’t line up.
If one wanted to create a network of connected polygons, how would one even find out what this offset was to undo it? Maybe I’m misreading it, but any chance the re-center could be optional?
–code:
local vertices = { 0, 0, 50, 0, 50, 50, 0, 50 }
local shad = display.newPolygon(100, 100, vertices)
shad:setFillColor (1, 1, 1)
local vertices2 = {0, 50, 50, 50, 50, 200, 25, 250, 0, 200}
local shad2 = display.newPolygon(100, 100, vertices2)
shad2:setFillColor (.5, .5, .5)
shad2.alpha = .5