1

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.

Marty
  • 39,033
  • 19
  • 93
  • 162
  • 1
    I wouldn't use `draw` and `copyPixels` at the same time. I would use `draw` upfront to create the flipped versions of your tiles first, and then continue using `copyPixels`. – Marty Sep 01 '13 at 06:38
  • Thanks, I managed to do that just the way you said. – Caio Rosisca Sep 01 '13 at 17:57

0 Answers0