Jump to content

mirror bitmapdata


lonelydatum
 Share

Recommended Posts

If by mirror you mean repeat, then just using BitmapData.draw will let you draw the contents of one to another. If you want to actually flip the image, probably the quickest way to do it is to just set the scale.x or scale.y of the Image/Sprite object the BitmapData is attached to to -1, using anchor.set(0.5) to have it behave predictably when doing so.

 

If you need the pixels themselves to be flipped, then you can use canvas transforms by accessing the bmdMirror.ctx property, which is a canvas 2D context, and the technique outlined in this tutorial: http://www.subshell.com/en/subshell/blog/image-manipulation-html5-canvas100.html

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...