pixi.geom.Matrix

type
class
metadata
:native
"PIXI.Matrix"

Constructor

new()
The Matrix class is now an object, which makes it a lot faster, here is a representation of it : | a | b | tx| | c | d | ty| | 0 | 0 | 1 |

Instance Variables

a : Float

b : Float

c : Float

d : Float

tx : Float

ty : Float

Instance Methods

append(matrix : Matrix) : Matrix

parameters
{Matrix} matrix
returns
{Matrix} This matrix. Good for chaining method calls.
Appends the given Matrix to this Matrix.

apply(pos : Point, ?newPos : Point) : Point

parameters
pos {Point} The origin
[newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
returns
{Point} The new point, transformed through this matrix
Get a new position with the current transformation applied. Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)

applyInverse(pos : Point, ?newPos : Point) : Point

parameters
pos {Point} The origin
[newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
returns
{Point} The new point, inverse-transformed through this matrix
Get a new position with the inverse of the current transformation applied. Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)

fromArray(array : Array<Float>) : Void

parameters
array {Array} The array that the matrix will be filled with
Creates a pixi matrix object based on the array given as a parameter

identity() : Matrix

returns
{Matrix} This matrix. Good for chaining method calls.
Resets this Matix to an identity (default) matrix.

rotate(angle : Float) : Matrix

parameters
{Float} angle The angle in radians.
returns
{Matrix} This matrix. Good for chaining method calls.
Applies a rotation transformation to the matrix.

scale(x : Float, y : Float) : Matrix

parameters
{Float} x The amount to scale horizontally
{Float} y The amount to scale vertically
returns
{Matrix} This matrix. Good for chaining method calls.
Applies a scale transformation to the matrix.

toArray(transpose : Bool) : Array<Float>

parameters
transpose {Bool} Whether we need to transpose the matrix or not
returns
{Array} the newly created array which contains the matrix
Creates an array from the current Matrix object

translate(x : Float, y : Float) : Matrix

parameters
{Float} x
{Float} y
returns
{Matrix} This matrix. Good for chaining method calls.
Translates the matrix on the x and y.