swift - How to get an SKNode's zRotation relative to its scene? -
is there way sknode's zrotation relative scene rather parent? or relative other sknode?
right i'm doing this:
func rotationrelativetoscenefornode(node: sknode) -> cgfloat { var noderotation = cgfloat(0) var tempnode: sknode = node while !(tempnode skscene) { noderotation += tempnode.zrotation tempnode = tempnode.parent! } return noderotation }
but i'm not sure best way it.
Comments
Post a Comment