Hello everyone!
I’m learning how to use Tilesheets. I created an atlas (spritesheet) with arrows. Then I drew that arrow in a Sprite so I can add MouseEvent’s:
var tiles : Tilesheet =
new Tilesheet(Assets.getBitmapData("img/sprites.png"));
var left : Sprite = new Sprite();
var id : Int = tiles.addTileRect(new Rectangle(0,0,64,128));
Well now there’s a catch. For the Flash target this works:
left.graphics.drawTiles(tiles, [0,0,id]);
However this code doesn’t work on native targets (including html5). The alternative is:
tiles.drawTiles(left.graphics, [0,0,id]);
Using any approach the MouseEvents attached to the Sprite stop working on all targets but Flash.
Strange, isn’t it?