Posted By

sidneydekoning on 05/14/09


Tagged

rotate Objects flip matrix fliping


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Pingpongbal


Flipping objects with a Matrix


 / Published in: ActionScript 3
 

  1. function flipHorizontal(dsp:DisplayObject):void {
  2. var matrix:Matrix = dsp.transform.matrix;
  3. matrix.a = -1;
  4. matrix.tx = dsp.width + dsp.x;
  5. dsp.transform.matrix = matrix;
  6. }
  7.  
  8. function flipVertical(dsp:DisplayObject):void {
  9. var matrix:Matrix = dsp.transform.matrix;
  10. matrix.d = -1;
  11. matrix.ty = dsp.height + dsp.y;
  12. dsp.transform.matrix = matrix;
  13. }

Report this snippet  

You need to login to post a comment.