Tillson
Tillson

Reputation: 530

SpriteKit coordinates relative to the master view

I'm making a Doodle-Jump like game, and I'm trying to test for if the player is below y:0 on the view. (that you access with self.view). I have the player inside a subview, so whenever I try to get the position, it gives the relative position of the player.

Upvotes: 0

Views: 61

Answers (1)

Tillson
Tillson

Reputation: 530

After a bit more googling, I was able to figure out that

CGPoint positionInScene = [self.scene convertPoint:self.position fromNode:self.parent];

fixed it!

Upvotes: 1

Related Questions