| Platform | Since |
|---|---|
| Android | 0.9 |
| iPhone | 0.9 |
| iPad | 0.9 |
The 2D Matrix is an object for holding values for an affine transformation matrix.
The 2DMatrix is created by Titanium.UI.create2DMatrix. A 2D matrix is used to rotate, scale, translate, or skew the objects in a two-dimensional space. A 2D matrix is represented by a 3 by 3 matrix. Because the third column is always (0,0,1), the data structure contains values for only the first two columns.
You create an identity matrix by creating a 2D Matrix with an empty constructor.
| Name | Summary |
|---|---|
| addEventListener |
Adds the specified callback as an event listener for the named event. |
| fireEvent |
Fires a synthesized event to any registered listeners. |
| getA |
Gets the value of the a property. (iPhone, iPad only.) |
| getB |
Gets the value of the b property. (iPhone, iPad only.) |
| getC |
Gets the value of the c property. (iPhone, iPad only.) |
| getD |
Gets the value of the d property. (iPhone, iPad only.) |
| getTx |
Gets the value of the tx property. (iPhone, iPad only.) |
| getTy |
Gets the value of the ty property. (iPhone, iPad only.) |
| invert |
Returns a matrix constructed by inverting an existing matrix |
| multiply |
Returns a matrix constructed by combining two existing matrix. |
| removeEventListener |
Removes the specified callback as an event listener for the named event. |
| rotate |
Returns a matrix constructed by rotating an existing matrix |
| scale |
Returns a matrix constructed by scaling an existing matrix |
| setA |
Sets the value of the a property. (iPhone, iPad only.) |
| setB |
Sets the value of the b property. (iPhone, iPad only.) |
| setC |
Sets the value of the c property. (iPhone, iPad only.) |
| setD |
Sets the value of the d property. (iPhone, iPad only.) |
| setTx |
Sets the value of the tx property. (iPhone, iPad only.) |
| setTy |
Sets the value of the ty property. (iPhone, iPad only.) |
| translate |
Returns a matrix constructed by translating an existing matrix |
| Name | Type | Summary |
|---|---|---|
| a | Number |
The entry at position [1,1] in the matrix. (iPhone, iPad only.) |
| b | Number |
The entry at position [1,2] in the matrix. (iPhone, iPad only.) |
| c | Number |
The entry at position [2,1] in the matrix. (iPhone, iPad only.) |
| d | Number |
The entry at position [2,2] in the matrix. (iPhone, iPad only.) |
| tx | Number |
The entry at position [3,1] in the matrix. (iPhone, iPad only.) |
| ty | Number |
The entry at position [3,2] in the matrix. (iPhone, iPad only.) |