Confusion about coordinates, frames & child nodes in SpriteKit on iOS?
I'm still playing around with learning SpriteKit in iOS & have been doing lots of reading & lots of experimenting. I'm confused by something else I've found* regarding coordinates, frames & child nodes. Consider this snippet of code, in which I'm trying to draw a green box around my spaceship sprite for debugging purposes: func addSpaceship() { let spaceship = SKSpriteNode.init(imageNamed: "rocketship.png") spaceship.name = "spaceship" // VERSION 1 spaceship.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)) let debugFrame = SKShapeNode(rect: spaceship.frame)