Matrix Class
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 |
Constructor
Matrix
()
Item Index
Methods
append
-
matrix
Appends the given Matrix to this Matrix.
Parameters:
-
matrix
Matrix
Returns:
This matrix. Good for chaining method calls.
apply
-
pos
-
[newPos]
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)
Parameters:
Returns:
The new point, transformed through this matrix
applyInverse
-
pos
-
[newPos]
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)
Parameters:
Returns:
The new point, inverse-transformed through this matrix
fromArray
-
array
Creates a pixi matrix object based on the array given as a parameter
Parameters:
-
array
ArrayThe array that the matrix will be filled with
identity
()
Matrix
Resets this Matix to an identity (default) matrix.
Returns:
This matrix. Good for chaining method calls.
rotate
-
angle
Applies a rotation transformation to the matrix.
Parameters:
-
angle
FloatThe angle in radians.
Returns:
This matrix. Good for chaining method calls.
scale
-
x
-
y
Applies a scale transformation to the matrix.
Parameters:
-
x
FloatThe amount to scale horizontally
-
y
FloatThe amount to scale vertically
Returns:
This matrix. Good for chaining method calls.