Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

setTransform

setTransform is an advanced function for directly manipulating the transformation matrix. It is designed for advanced users, and not for beginners. For most cases, 'rotate', 'scale' and 'translate' are the best functions to use.

setTransform( m11, m12, m21, m22, dx, dy )

This sets a new transformation matrix onto the canvas. The parameters are numbers describing the new matrix.

In differs from 'transform' in that this will replace the matrix, whilst transform will be applied to the current matrix.

It can be undone by calling 'undoTransform', or 'clearTransforms' to remove all transformations which have been applied.

See Also