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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -