Core. Matrix

Matrix Class represents a transformation matrix that determines how to map points from one coordinate space to another.

You can perform a different graphical conversion of a display object, by setting it up Matrix Object properties that will Matrix Object that is applied to the Transform object Matrix Property, and then apply the Transform object as the transform property of the display object. These translation functions include translation (x and Y relocation), rotation, scaling, and skew.

Constructor

new Matrix(aopt, bopt, copt, dopt, txopt, tyopt)

Creates a new one with the specified parameter Matrix Object.
Parameters:
Name Type Attributes Default Description
a Number <optional>
1 a (optional) a value that affects the location of pixels along the X axis when scaling or rotating images.
b Number <optional>
0 b (optional) a value that affects the positioning of pixels along the Y axis when rotating or tilting an image.
c Number <optional>
0 c (optional) a value that affects the positioning of pixels along the X axis when rotating or tilting an image.
d Number <optional>
1 d (optional) a value that affects the location of pixels along the Y axis when scaling or rotating images.
tx Number <optional>
0 tx (optional) the distance of each point along the X axis.
ty Number <optional>
0 ty (optional) the distance of each point along the Y axis.

Member

(static) TEMP :Matrix

Used for transit Matrix Object.

a :Number

When scaling or rotating an image, it affects the value of pixels positioned along the X axis.

b :Number

When rotating or tilting an image, it affects the location of pixels along the Y axis.

c :Number

When rotating or tilting an image, it affects the location of pixels along the X axis.

d :Number

When scaling or rotating an image, it affects the value of pixels positioned along the Y axis.

tx :Number

Translate the distance along each point along the X axis.

ty :Number

Translate the distance along each point along the Y axis.

Methods

clone() → {Matrix}

Return here Matrix Copy of object.
Returns:
Type:
Matrix
A new property of the same property as the original instance Matrix Example。

concat(matrix) → {Matrix}

The specified matrix is connected to the current matrix so that the geometric effects of the two matrices are effectively combined.
Parameters:
Name Type Description
matrix Matrix The matrix to connect to the source matrix.
Returns:
Type:
Matrix
Current matrix.

copyTo(dec) → {Matrix}

Current Matrix Copy all of the matrix data in the object to the specified Matrix In object.
Parameters:
Name Type Description
dec Matrix To copy the current matrix data Matrix Object.
Returns:
Type:
Matrix
That has copied the current matrix data Matrix Object.

create() → {Matrix}

Create one from the object pool Matrix Object.
Returns:
Type:
Matrix
Matrix object.

destroy()

Destroy this object.

getScaleX() → {Number}

Gets the X axis scale value.
Returns:
Type:
Number
X axis scaling.

getScaleY() → {Number}

Gets the Y axis scale value.
Returns:
Type:
Number
Y axis scaling.

identity() → {Matrix}

Set the matrix as a unit matrix.
Returns:
Type:
Matrix
Returns the current rectangle.

invert() → {Matrix}

Performs inverse transformations of the original matrix.
Returns:
Type:
Matrix
Current matrix object.

invertTransformPoint(out) → {Point}

Applies the inverse transformation of the current matrix to the specified point and returns the point.
Parameters:
Name Type Description
out Point The point Point object to be converted.
Returns:
Type:
Point
Return out

mul(m1, m2, out) → {Matrix}

The result of multiplying the specified two matrices is assigned to the specified output object.
Parameters:
Name Type Description
m1 Matrix Matrix one.
m2 Matrix Matrix two.
out Matrix Output object.
Returns:
Type:
Matrix
As a result, the output object out.

mul16(m1, m2, out) → {Array}

Multiplies the specified two matrices, and the result is assigned to the specified output array, length 16.
Parameters:
Name Type Description
m1 Matrix Matrix one.
m2 Matrix Matrix two.
out Array Output object Array.
Returns:
Type:
Array
As a result, the output object out.

rotate(angle)

Yes Matrix Object applies spin conversion.
Parameters:
Name Type Description
angle Number The angle of rotation in radians.

scale(x, y)

Apply scaling transformations to matrices.
Parameters:
Name Type Description
x Number The multiplier used to scale objects along the X axis.
y Number The multiplier used to scale objects along the Y axis.

setTo(a, b, c, d, tx, ty) → {Matrix}

take Matrix The member is set to the specified value.
Parameters:
Name Type Description
a Number When scaling or rotating an image, it affects the value of pixels positioned along the X axis.
b Number When rotating or tilting an image, it affects the location of pixels along the Y axis.
c Number When rotating or tilting an image, it affects the location of pixels along the X axis.
d Number When scaling or rotating an image, it affects the value of pixels positioned along the Y axis.
tx Number Translate the distance along each point along the X axis.
ty Number Translate the distance along each point along the Y axis.
Returns:
Type:
Matrix
Current matrix object.

setTranslate(x, y) → {Matrix}

Sets the distance to each point along the X and Y axes.
Parameters:
Name Type Description
x Number Translate the distance along each point along the X axis.
y Number Translate the distance along each point along the Y axis.
Returns:
Type:
Matrix
Returns the object itself

skew(x, y) → {Matrix}

Yes Matrix Object using skew transformation.
Parameters:
Name Type Description
x Number Bend the 2D along the X axis.
y Number Bend the 2D along the Y axis.
Returns:
Type:
Matrix
current Matrix Object.

toString() → {String}

Returns listing Matrix The text value of the object property.
Returns:
Type:
String
A string that contains Matrix Object property values: A, B, C, D, TX, and ty.

transformPoint(out) → {Point}

take Matrix The geometric transformations represented by the object are applied to the specified points.
Parameters:
Name Type Description
out Point A point used to set output results.
Returns:
Type:
Point
Return out

transformPointN(out) → {Point}

take Matrix Object representation of the geometric transformation applied to the specified point, ignoring TX, ty.
Parameters:
Name Type Description
out Point A point used to set output results.
Returns:
Type:
Point
Return out

translate(x, y) → {Matrix}

The translation matrix along the X and Y axes, the translation change, is specified by the X and Y parameters.
Parameters:
Name Type Description
x Number The amount of movement along the X axis (in pixels).
y Number The amount of moving along the axial direction of Y (in pixels).
Returns:
Type:
Matrix
Returns this rectangle object.