How to replace bitmapData.copyPixels() with bitmapData.draw()

538 views Asked by At

I'm trying to draw a level of my game using a tileset and a xml with the info. It works using copyPixels, but some tiles need to be flipped before they are drawn, so for that I need to use draw() instead of copyPixels(), but I can't get it to work. This is how I use copyPixes:

rectangleSelection = (desiredTile.x, desiredTile.y, tileWidth, tileHeight);

bmpData.copyPixels(tileset.bitmapData, rectangleSelection, new Point(pt.x, pt.y));
//pt.x and pt.y = tile location to be drawn().

How can I do the same thing using the bitmapData.draw() method? I just can't make it work.

0

There are 0 answers