I tried to understand the basics of anchor points in swift reading this : https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Nodes/Nodes.html
I understood that in siwft, with sprite kit, the anchor point of the scene is in the down-left corner of the screen.
So if I position a node like this :
myNode.position = CGPoint(x: 0, y: 0)
self.addChild(myNode)
It doesn't appear on my view. So i tried another thing :
myNode.position = CGPoint(x: middleOfmyView, y: 0)
self.addChild(myNode)
And now I see half of the top of my square. So I see 20 pixels up from the bottom of the screen.
So I added :
myNode.position = CGPoint(x: middleOfmyView, y: 0+myNode.frame.size.height/2)
self.addChild(myNode)
And now I can see my entire square, on the middle of the screen.
Then I put it at x: 0 and let the Y point like that :
myNode.position = CGPoint(x: 0, y: 0+myNode.frame.size.height/2)
self.addChild(myNode)
And now I can't see my node appearing even if there is written "1 Node" in the bottom right corner of my screen!
So i'm wondering is the 0,0 point of the iPhone screen really on the down-left corner of the screen ? Then where is the anchorpoint of my sprite node? How can I put my square right in the down left corner of my screen ?
This is all just to understand how things work… Thanks a lot in advance for your help :)
I'm using Xcode 7.3.1 and I still do not understand why the point 0 makes that I do not see my stuff… it's definitely a bug ?