Titanium.UI.3DMatrix
> Titanium.UI.3DMatrix

The 3D Matrix is an object for holding values for a 3D affine transform.

The 3DMatrix is created by Titanium.UI.create3DMatrix. A 3D transform is used to rotate, scale, translate, or skew the objects in three-dimensional space. A 3D transform is represented by a 4 by 4 matrix.

You create an identity matrix by creating a 3D Matrix with an empty constructor.

Examples

Apply a 3D Matrix to a Label

Move a label through a translation that repositions it from 100px to 200px from the top of the display.

var win = Ti.UI.createWindow({
  backgroundColor: 'white'
});

var label = Ti.UI.createLabel({
  font:{fontSize:50},
  text:'Titanium',
  textAlign:'center',
  top: 100
});
win.add(label);

var button = Ti.UI.createButton({
  title:'Animate',
  bottom:20,
  width:200, height:40
});
win.add(button);

button.addEventListener('click', function(){
  var t1 = Ti.UI.create3DMatrix();
  t1 = t1.translate(0, 100, 200);
  t1.m34 = 1.0/-90;
  var a1 = Ti.UI.createAnimation();
  a1.transform = t1;
  a1.duration = 800;
  label.animate(a1);
});
win.open();
  • 0.9
  • 0.9
Defined By

Properties

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Titanium.UI.3DMatrix
m11 : Number

The entry at position [1,1] in the matrix.

The entry at position [1,1] in the matrix.

Titanium.UI.3DMatrix
m12 : Number

The entry at position [1,2] in the matrix.

The entry at position [1,2] in the matrix.

Titanium.UI.3DMatrix
m13 : Number

The entry at position [1,3] in the matrix.

The entry at position [1,3] in the matrix.

Titanium.UI.3DMatrix
m14 : Number

The entry at position [1,4] in the matrix.

The entry at position [1,4] in the matrix.

Titanium.UI.3DMatrix
m21 : Number

The entry at position [2,1] in the matrix.

The entry at position [2,1] in the matrix.

Titanium.UI.3DMatrix
m22 : Number

The entry at position [2,2] in the matrix.

The entry at position [2,2] in the matrix.

Titanium.UI.3DMatrix
m23 : Number

The entry at position [2,3] in the matrix.

The entry at position [2,3] in the matrix.

Titanium.UI.3DMatrix
m24 : Number

The entry at position [2,4] in the matrix.

The entry at position [2,4] in the matrix.

Titanium.UI.3DMatrix
m31 : Number

The entry at position [3,1] in the matrix.

The entry at position [3,1] in the matrix.

Titanium.UI.3DMatrix
m32 : Number

The entry at position [3,2] in the matrix.

The entry at position [3,2] in the matrix.

Titanium.UI.3DMatrix
m33 : Number

The entry at position [3,3] in the matrix.

The entry at position [3,3] in the matrix.

Titanium.UI.3DMatrix
m34 : Number

The entry at position [3,4] in the matrix.

The entry at position [3,4] in the matrix.

Titanium.UI.3DMatrix
m41 : Number

The entry at position [4,1] in the matrix.

The entry at position [4,1] in the matrix.

Titanium.UI.3DMatrix
m42 : Number

The entry at position [4,2] in the matrix.

The entry at position [4,2] in the matrix.

Titanium.UI.3DMatrix
m43 : Number

The entry at position [4,3] in the matrix.

The entry at position [4,3] in the matrix.

Titanium.UI.3DMatrix
m44 : Number

The entry at position [4,4] in the matrix.

The entry at position [4,4] in the matrix.

Defined By

Methods

Adds the specified callback as an event listener for the named event. ...

Adds the specified callback as an event listener for the named event.

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

  • name : String

    Name of the event.

  • event : Dictionary

    A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m11 property. ...

Gets the value of the m11 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m12 property. ...

Gets the value of the m12 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m13 property. ...

Gets the value of the m13 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m14 property. ...

Gets the value of the m14 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m21 property. ...

Gets the value of the m21 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m22 property. ...

Gets the value of the m22 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m23 property. ...

Gets the value of the m23 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m24 property. ...

Gets the value of the m24 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m31 property. ...

Gets the value of the m31 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m32 property. ...

Gets the value of the m32 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m33 property. ...

Gets the value of the m33 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m34 property. ...

Gets the value of the m34 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m41 property. ...

Gets the value of the m41 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m42 property. ...

Gets the value of the m42 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m43 property. ...

Gets the value of the m43 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Number
Gets the value of the m44 property. ...

Gets the value of the m44 property.

Returns

  • Number
Titanium.UI.3DMatrix
( ) : Titanium.UI.3DMatrix
Returns a matrix constructed by inverting this matrix. ...

Returns a matrix constructed by inverting this matrix.

Returns

Titanium.UI.3DMatrix
( t2 ) : Titanium.UI.3DMatrix
Returns a matrix constructed by combining two existing matrix. ...

Returns a matrix constructed by combining two existing matrix.

The result of this function is the first matrix multiplied by the second matrix. You might perform several multiplications in order to create a single matrix that contains the cumulative effects of several transformations. Note that matrix operations are not commutative - the order in which you concatenate matrices is important. That is, the result of multiplying matrix t1 by matrix t2 does not necessarily equal the result of multiplying matrix t2 by matrix t1.

Parameters

Returns

Removes the specified callback as an event listener for the named event. ...

Removes the specified callback as an event listener for the named event.

Multiple listeners can be registered for the same event, so the callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to remove. Must be the same function passed to addEventListener.

Returns

  • void
Titanium.UI.3DMatrix
( angle, x, y, z ) : Titanium.UI.3DMatrix
Returns a matrix constructed by rotating this matrix. ...

Returns a matrix constructed by rotating this matrix.

Parameters

  • angle : Number

    The angle, in degrees, by which to rotate the matrix. A positive value specifies counterclockwise rotation and a negative value specifies clockwise rotation.

  • x : Number

    The x part of the vector about which to rotate.

  • y : Number

    The y part of the vector about which to rotate.

  • z : Number

    The z part of the vector about which to rotate.

Returns

Titanium.UI.3DMatrix
( sx, sy, sz ) : Titanium.UI.3DMatrix
Returns a matrix constructed by scaling this matrix. ...

Returns a matrix constructed by scaling this matrix.

Parameters

  • sx : Number

    The value by which to scale x values of the matrix.

  • sy : Number

    The value by which to scale y values of the matrix.

  • sz : Number

    The value by which to scale z values of the matrix.

Returns

Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Titanium.UI.3DMatrix
( m11 )
Sets the value of the m11 property. ...

Sets the value of the m11 property.

Parameters

  • m11 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m12 )
Sets the value of the m12 property. ...

Sets the value of the m12 property.

Parameters

  • m12 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m13 )
Sets the value of the m13 property. ...

Sets the value of the m13 property.

Parameters

  • m13 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m14 )
Sets the value of the m14 property. ...

Sets the value of the m14 property.

Parameters

  • m14 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m21 )
Sets the value of the m21 property. ...

Sets the value of the m21 property.

Parameters

  • m21 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m22 )
Sets the value of the m22 property. ...

Sets the value of the m22 property.

Parameters

  • m22 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m23 )
Sets the value of the m23 property. ...

Sets the value of the m23 property.

Parameters

  • m23 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m24 )
Sets the value of the m24 property. ...

Sets the value of the m24 property.

Parameters

  • m24 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m31 )
Sets the value of the m31 property. ...

Sets the value of the m31 property.

Parameters

  • m31 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m32 )
Sets the value of the m32 property. ...

Sets the value of the m32 property.

Parameters

  • m32 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m33 )
Sets the value of the m33 property. ...

Sets the value of the m33 property.

Parameters

  • m33 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m34 )
Sets the value of the m34 property. ...

Sets the value of the m34 property.

Parameters

  • m34 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m41 )
Sets the value of the m41 property. ...

Sets the value of the m41 property.

Parameters

  • m41 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m42 )
Sets the value of the m42 property. ...

Sets the value of the m42 property.

Parameters

  • m42 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m43 )
Sets the value of the m43 property. ...

Sets the value of the m43 property.

Parameters

  • m43 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( m44 )
Sets the value of the m44 property. ...

Sets the value of the m44 property.

Parameters

  • m44 : Number

    New value for the property.

Returns

  • void
Titanium.UI.3DMatrix
( tx, ty, tz ) : Titanium.UI.3DMatrix
Returns a matrix constructed by translating an existing matrix. ...

Returns a matrix constructed by translating an existing matrix.

Parameters

  • tx : Number

    The value by which to move x values with the matrix.

  • ty : Number

    The value by which to move y values with the matrix.

  • tz : Number

    The value by which to move z values with the matrix.

Returns