Hi.
I was having a problem trying to put one image upon another when one of the images was rotated. I noticed that that happened because the anchorX and anchorY kind of rotate together with the object. E.g: If you rotate 90 degrees an object, the anchorX value would be actually the anchorY value.
You can see that situation by running the code below. I create a red rectangle and rotate it. Then I create a green rectangle and set its position to be the same as the red one, but they do not be end overlapped.
local rectRed = display.newRect(0,0,100,100) rectRed:setFillColor(255/255, 0/255, 0/255) rectRed.anchorX = 0 rectRed.anchorY = 1 rectRed.x = display.contentCenterX rectRed.y = display.contentCenterY rectRed.rotation = 90 local rectGreen = display.newRect(0,0,100,100) rectGreen:setFillColor(0/255, 255/255, 0/255) rectGreen.anchorX = rectRed.anchorX rectGreen.anchorY = rectRed.anchorY rectGreen.x = rectRed.x rectGreen.y = rectRed.y
At first I found that to be a bug, but now I really don’t know. What you guys think?