Just started converting a large project to Graphics 2. Anchor Points have turned out to be not a simple case of substituting setReferencePoint with anchorX and anchorY.
Using setReference:BottomCenter, the rays used to rotate around the BottomCenter. But using anchorX and anchorY, each of the rays now only rotate around their center points and not 1, 0.5 (bottomCenter).
local ray = {} local rot = 0 local i for i = 1, 16 do ray[i] = display.newImageRect( imgDir.. "sunray.png", 165, 1624 ); ray[i].anchorX, ray[i].anchorY = 1, 0.5 -- Bottom Center -- THIS DOESNT WORK. -- ray[i]:setReferencePoint(display.BottomCenterReferencePoint) -- THIS WORKS. ray[i].rotation = rot rot = ray[i].rotation + 22.5 ray[i].x = 1024 ray[i].y = 768 ray[i].alpha = 1 ray[i].myName = "ray"..i end
We tried ray[i].anchorChildren = true before or after setting the anchors but that didn’t seem to work either…
Hope this is something easy. Any help would be great.