Skip to content

Commit d6fb667

Browse files
committed
Added getCSSMatrix
1 parent ab35dfa commit d6fb667

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/gameobjects/components/TransformMatrix.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,21 @@ var TransformMatrix = new Class({
727727
return this;
728728
},
729729

730+
/**
731+
* Returns a string that can be used in a CSS Transform call as a `matrix` property.
732+
*
733+
* @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix
734+
* @since 3.12.0
735+
*
736+
* @return {string} A string containing the CSS Transform matrix values.
737+
*/
738+
getCSSMatrix: function ()
739+
{
740+
var m = this.matrix;
741+
742+
return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';
743+
},
744+
730745
/**
731746
* Destroys this Transform Matrix.
732747
*

0 commit comments

Comments
 (0)