简体   繁体   中英

How to obtain zRotation of a sprite relative to world coordinates?

For example if you have a rotated sprite, to which you add another rotated sprite, and so on. How would you determine the on-screen zRotation of a sub-sprite, or the "absolute" rotation of a sprite?

If I'm not grossly mistaken, it's simply the sum of all zRotation properties of the node and its parents (excluding the scene).

For example:

CGFloat absoluteRotation = self.zRotation + self.parent.zRotation;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM