Class Index | File Index

Classes


Class Matrix2D

Represents an affine tranformation matrix, and provides tools for constructing and concatenating matrixes.
Defined in: Matrix2D.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Matrix2D(a, b, c, d, tx, ty)
Constructs a new Matrix2D instance.
Field Summary
Field Attributes Field Name and Description
 
a
Position (0, 0) in a 3x3 affine transformation matrix.
 
Property representing the alpha that will be applied to a display object.
 
b
Position (0, 1) in a 3x3 affine transformation matrix.
 
c
Position (1, 0) in a 3x3 affine transformation matrix.
 
Property representing the compositeOperation that will be applied to a display object.
 
d
Position (1, 1) in a 3x3 affine transformation matrix.
<static>  
Matrix2D.DEG_TO_RAD
Multiplier for converting degrees to radians.
<static>  
Matrix2D.identity
An identity matrix, representing a null transformation.
 
Property representing the shadow that will be applied to a display object.
 
tx
Position (2, 0) in a 3x3 affine transformation matrix.
 
ty
Position (2, 1) in a 3x3 affine transformation matrix.
Method Summary
Method Attributes Method Name and Description
 
appendMatrix(matrix)
Appends the specified matrix with this matrix.
 
appendProperties(alpha, shadow, compositeOperation)
Appends the specified visual properties to the current matrix.
 
appendTransform(x, y, scaleX, scaleY, rotation, skewX, skewY, regX, regY)
Generates matrix properties from the specified display object transform properties, and appends them with this matrix.
 
Returns a clone of this Matrix.
 
decompose(target)
Decomposes the matrix into transform properties (x, y, scaleX, scaleY, and rotation).
 
Sets the properties of the matrix to those of an identity matrix (one that applies a null transformation).
 
Inverts the matrix, causing it to perform the opposite transformation.
 
prepend(a, b, c, d, tx, ty)
Concatenates the specified matrix properties with this matrix.
 
prependMatrix(matrix)
Prepends the specified matrix with this matrix.
 
prependProperties(alpha, shadow, compositeOperation)
Prepends the specified visual properties to the current matrix.
 
prependTransform(x, y, scaleX, scaleY, rotation, skewX, skewY, regX, regY)
Generates matrix properties from the specified display object transform properties, and prepends them with this matrix.
 
rotate(angle)
Applies a rotation transformation to the matrix.
 
scale(x, y)
Applies a scale transformation to the matrix.
 
skew(skewX, skewY)
Applies a skew transformation to the matrix.
 
Returns a string representation of this object.
 
translate(x, y)
Translates the matrix on the x and y axes.
Class Detail
Matrix2D(a, b, c, d, tx, ty)
Constructs a new Matrix2D instance.
Parameters:
a
Specifies the a property for the new matrix.
b
Specifies the b property for the new matrix.
c
Specifies the c property for the new matrix.
d
Specifies the d property for the new matrix.
tx
Specifies the tx property for the new matrix.
ty
Specifies the ty property for the new matrix.
Field Detail
a
Position (0, 0) in a 3x3 affine transformation matrix.

alpha
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.

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

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

compositeOperation
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.

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

<static> Matrix2D.DEG_TO_RAD
Multiplier for converting degrees to radians. Used internally by Matrix2D.

<static> Matrix2D.identity
An identity matrix, representing a null transformation. Read-only.

shadow
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.

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

ty
Position (2, 1) in a 3x3 affine transformation matrix.
Method Detail
appendMatrix(matrix)
Appends the specified matrix with this matrix.
Parameters:
matrix

appendProperties(alpha, shadow, compositeOperation)
Appends the specified visual properties to the current matrix.
Parameters:
alpha
desired alpha value
shadow
desired shadow value
compositeOperation
desired composite operation value

appendTransform(x, y, scaleX, scaleY, rotation, skewX, skewY, regX, regY)
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:
x
y
scaleX
scaleY
rotation
skewX
skewY
regX
Optional.
regY
Optional.

clone()
Returns a clone of this Matrix.

decompose(target)
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
The object to apply the transform properties to. If null, then a new object will be returned.

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

invert()
Inverts the matrix, causing it to perform the opposite transformation.

prepend(a, b, c, d, tx, ty)
Concatenates the specified matrix properties with this matrix. You must provide values for all of the parameters.
Parameters:
a
b
c
d
tx
ty

prependMatrix(matrix)
Prepends the specified matrix with this matrix.
Parameters:
matrix

prependProperties(alpha, shadow, compositeOperation)
Prepends the specified visual properties to the current matrix.
Parameters:
alpha
desired alpha value
shadow
desired shadow value
compositeOperation
desired composite operation value

prependTransform(x, y, scaleX, scaleY, rotation, skewX, skewY, regX, regY)
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:
x
y
scaleX
scaleY
rotation
skewX
skewY
regX
Optional.
regY
Optional.

rotate(angle)
Applies a rotation transformation to the matrix.
Parameters:
angle
The angle in degrees.

scale(x, y)
Applies a scale transformation to the matrix.
Parameters:
x
y

skew(skewX, skewY)
Applies a skew transformation to the matrix.
Parameters:
skewX
The amount to skew horizontally in degrees.
skewY
The amount to skew vertically in degrees.

toString()
Returns a string representation of this object.

translate(x, y)
Translates the matrix on the x and y axes.
Parameters:
x
y

Documentation generated by JsDoc Toolkit 2.3.2 on Sun Feb 13 2011 22:46:01 GMT-0700 (MST)