Reputation: 548
Both of them, do the same. so, are they completely same as each other or there is difference?
Upvotes: 0
Views: 137
Reputation: 52183
Conceptually they are the same, but there is some difference to be aware of.
Display objects can either be 2d (transform.matrix
) or 3d (transform.matrix3D
), but not both. The rotation
property reflects rotation of the matrix
or matrix3D
, while rotationZ
explicitly represents rotation around the Z axis of the matrix3D
property. The difference here is that if you set rotationZ
it will, like all 3d properties (z
, rotationX
, etc), convert the display object to 3d (transform.matrix3D
) even if no other 3d properties are set. For example:
var sprite:Sprite = new Sprite();
sprite.rotation = 50;
trace(sprite.transform.matrix); // [object Matrix]
trace(sprite.transform.matrix3D) // null
sprite.rotationZ = 50;
trace(sprite.transform.matrix); // null
trace(sprite.transform.matrix3D) // [object Matrix3D]
This is notable because the 3d rendering (transform.matrix3D
) does introduce some blurring due to the way 3d is projected onto 2d, while 2d rendering (transform.matrix
) does not.
So, if you aren't going to use any other 3d properties, stick to rotation
. If you are going to use other 3d properties, using rotationZ
makes more sense.
Other than that, they are the same. ;)
Hope that helps.
Upvotes: 2