Looking for the absolute position of a child SKNode?

I have an SKSpriteNode that has a parent scroll template (like a child). SKSpriteNode does not move, it just moves along with the scroll layer. What is the best way to find the absolute position of the SKSpriteNode when moving the background.

+6
source share
1 answer
CGPoint positionInScene = [self.scene convertPoint:self.position fromNode:self.parent]; 

However, convertPoint:fromNode: quite expensive, especially if you use it in the update method. I would rather just add childNode x to the position of parentNode x :

 CGFloat xPosition = self.position.x + self.parent.position.x; 
+10
source

All Articles