API Documentation for: 0.6.0
Show:

Matrix2D Class

Defined in: Matrix2D:34
Module: EaselJS

Represents an affine transformation matrix, and provides tools for constructing and concatenating matrixes.

Constructor

Matrix2D

(
  • a
  • b
  • c
  • d
  • tx
  • ty
)

Defined in Matrix2D:34

Parameters:

  • a Number

    Specifies the a property for the new matrix.

  • b Number

    Specifies the b property for the new matrix.

  • c Number

    Specifies the c property for the new matrix.

  • d Number

    Specifies the d property for the new matrix.

  • tx Number

    Specifies the tx property for the new matrix.

  • ty Number

    Specifies the ty property for the new matrix.

Methods

append

(
  • a
  • b
  • c
  • d
  • tx
  • ty
)
Matrix2D

Defined in append:183

Appends the specified matrix properties with this matrix. All parameters are required.

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

appendMatrix

(
  • matrix
)
Matrix2D

Defined in appendMatrix:220

Appends the specified matrix with this matrix.

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

appendProperties

(
  • alpha
  • shadow
  • compositeOperation
)
Matrix2D

Appends the specified visual properties to the current matrix.

Parameters:

  • alpha Number

    desired alpha value

  • shadow Shadow

    desired shadow value

  • compositeOperation String

    desired composite operation value

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

appendProperties

(
  • a
  • b
  • c
  • d
  • tx
  • ty
  • alpha
  • shadow
  • compositeOperation
)
Matrix2D

Reinitializes all matrix properties to those specified.

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

appendTransform

(
  • x
  • y
  • scaleX
  • scaleY
  • rotation
  • skewX
  • skewY
  • regX
  • regY
)
Matrix2D

Defined in appendTransform:274

Generates matrix properties from the specified display object transform properties, and appends them with this matrix. For example, you can use this to generate a matrix from a display object: var mtx = new Matrix2D(); mtx.appendTransform(o.x, o.y, o.scaleX, o.scaleY, o.rotation);

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

clone

() Matrix2D

Defined in clone:511

Returns a clone of the Matrix2D instance.

Returns:

Matrix2D: a clone of the Matrix2D instance.

decompose

(
  • target
)
Matrix2D

Defined in decompose:426

Decomposes the matrix into transform properties (x, y, scaleX, scaleY, and rotation). Note that this these values may not match the transform properties you used to generate the matrix, though they will produce the same visual results.

Parameters:

  • target Object

    The object to apply the transform properties to. If null, then a new object will be returned.

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

identity

() Matrix2D

Defined in identity:383

Sets the properties of the matrix to those of an identity matrix (one that applies a null transformation).

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

initialize

() Matrix2D protected

Defined in initialize:140

Initialization method.

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

invert

() Matrix2D

Defined in invert:395

Inverts the matrix, causing it to perform the opposite transformation.

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

isIdentity

() Boolean

Defined in isIdentity:417

Returns true if the matrix is an identity matrix.

Returns:

prepend

(
  • a
  • b
  • c
  • d
  • tx
  • ty
)
Matrix2D

Defined in prepend:157

Concatenates the specified matrix properties with this matrix. All parameters are required.

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

prependMatrix

(
  • matrix
)

Defined in prependMatrix:209

Prepends the specified matrix with this matrix.

Parameters:

prependProperties

(
  • alpha
  • shadow
  • compositeOperation
)
Matrix2D

Prepends the specified visual properties to the current matrix.

Parameters:

  • alpha Number

    desired alpha value

  • shadow Shadow

    desired shadow value

  • compositeOperation String

    desired composite operation value

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

prependTransform

(
  • x
  • y
  • scaleX
  • scaleY
  • rotation
  • skewX
  • skewY
  • regX
  • regY
)
Matrix2D

Generates matrix properties from the specified display object transform properties, and prepends them with this matrix. For example, you can use this to generate a matrix from a display object: var mtx = new Matrix2D(); mtx.prependTransform(o.x, o.y, o.scaleX, o.scaleY, o.rotation);

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

rotate

(
  • angle
)
Matrix2D

Defined in rotate:318

Applies a rotation transformation to the matrix.

Parameters:

  • angle Number

    The angle in degrees.

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

scale

(
  • x
  • y
)
Matrix2D

Defined in scale:355

Applies a scale transformation to the matrix.

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

skew

(
  • skewX
  • skewY
)
Matrix2D

Defined in skew:341

Applies a skew transformation to the matrix.

Parameters:

  • skewX Number

    The amount to skew horizontally in degrees.

  • skewY Number

    The amount to skew vertically in degrees.

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

toString

() String

Defined in toString:524

Returns a string representation of this object.

Returns:

String: a string representation of the instance.

translate

(
  • x
  • y
)
Matrix2D

Defined in translate:370

Translates the matrix on the x and y axes.

Parameters:

Returns:

Matrix2D: This matrix. Useful for chaining method calls.

Properties

a

Number

Defined in a:71

Position (0, 0) in a 3x3 affine transformation matrix.

alpha

Number

Defined in alpha:113

Property representing the alpha that will be applied to a display object. This is not part of matrix operations, but is used for operations like getConcatenatedMatrix to provide concatenated alpha values.

atx

Number

Defined in atx:99

Position (2, 0) in a 3x3 affine transformation matrix.

b

Number

Defined in b:78

Position (0, 1) in a 3x3 affine transformation matrix.

c

Number

Defined in c:85

Position (1, 0) in a 3x3 affine transformation matrix.

compositeOperation

String

Property representing the compositeOperation that will be applied to a display object. This is not part of matrix operations, but is used for operations like getConcatenatedMatrix to provide concatenated compositeOperation values. You can find a list of valid composite operations at: https://developer.mozilla.org/en/Canvas_tutorial/Compositing

d

Number

Defined in d:92

Position (1, 1) in a 3x3 affine transformation matrix.

DEG_TO_RAD

Number final static

Defined in DEG_TO_RAD:60

Multiplier for converting degrees to radians. Used internally by Matrix2D. Read-only.

identity

Matrix2D static

Defined in identity:52

An identity matrix, representing a null transformation. Read-only.

shadow

Shadow

Defined in shadow:121

Property representing the shadow that will be applied to a display object. This is not part of matrix operations, but is used for operations like getConcatenatedMatrix to provide concatenated shadow values.

ty

Number

Defined in ty:106

Position (2, 1) in a 3x3 affine transformation matrix.