I haven’t worked with AS3 for a few months, and even when I did I never took the time to learn it to extensively :|…
I’m creating an isometric map editor, the bitmap that I’m using to take the tiles from has a transparent background, but when I draw the tiles to the main bitmap it displays as white, so it messes up the overlapping (since they’re isometric)… How can I make the background of it transparent?
This is my function to grab the tile from the tile sheet.
private function getImageFromSheet(s:Number):Bitmap
{
var sheetCols:int = tSheet.width / tWidth;
var row:int = Math.floor(s / sheetCols);
var col:int = s - (row * sheetCols);
var rect:Rectangle = new Rectangle(col * tWidth, row * tHeightReal, tWidth, tHeightReal);
var pt:Point = new Point(0, 0);
var bmp:Bitmap = new Bitmap(new BitmapData(tWidth, tHeightReal, true, 0));
bmp.bitmapData.copyPixels (tSheet, rect, pt, null, null, true);
return bmp;
}
Thanks for any help.