I have a child node added to another node. I want to get the child nodes position with respect to the views coordinates and not the parent nodes coordinates
Get the child node's position
with respect to its parent, then use the convertPoint:fromNode:
or convertPoint:toNode:
method to convert from the parent node's coordinate system to the scene's coordinate system. (Remember, SKScene
inherits from SKNode
and is the root of the node hierarchy, so you can use it with either of those methods.) If you then need to work in the UIKit view coordinate space, use the scene's convertPointToView:
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With