File tree Expand file tree Collapse file tree
src/gameobjects/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -491,6 +491,32 @@ var Transform = {
491491 }
492492
493493 return tempMatrix ;
494+ } ,
495+
496+ /**
497+ * Gets the sum total rotation of all of this Game Objects parent Containers.
498+ *
499+ * The returned value is in radians and will be zero if this Game Object has no parent container.
500+ *
501+ * @method Phaser.GameObjects.Components.Transform#getParentRotation
502+ * @since 3.18.0
503+ *
504+ * @return {number } The sum total rotation, in radians, of all parent containers of this Game Object.
505+ */
506+ getParentRotation : function ( )
507+ {
508+ var rotation = 0 ;
509+
510+ var parent = this . parentContainer ;
511+
512+ while ( parent )
513+ {
514+ rotation += parent . rotation ;
515+
516+ parent = parent . parentContainer ;
517+ }
518+
519+ return rotation ;
494520 }
495521
496522} ;
You can’t perform that action at this time.
0 commit comments