package src.utils { import flash.display.MovieClip; import flash.geom.Point; import flash.display.Stage; import flash.events.Event; import flash.events.MouseEvent; import flash.display.Sprite; import flash.ui.Mouse; import src.editor.Anchor; import src.editor.References; import src.utils.ImageGIF; import src.game.Window; import src.game.Map; import flash.display.BitmapData; import flash.display.Bitmap; import flash.display.Loader; import flash.net.URLRequest; import flash.events.Event; import flash.geom.Matrix; public class ImageTile extends Sprite { public var file:String=new String(); private var w:int=0; private var h:int=0; private var map:Map=null; public var loader:Loader = new Loader(); public var loc:String=new String(); public var isTile:Number=new Number(); // ASSUME ALL TILES HAVE BEEN PRELOADED. // map is to reference the preLoadedImages array and load in images or save them if we are preloading now public function ImageTile(map,tileDN,w=0,h=0) { this.map=map; this.w=w; this.h=h; // since its a tile we assume its been preloaded and load the image via already saved bitmap data //trace("[TileImage.as] attempting to display tile of DN "+tileDN); showImage(map.tileType[tileDN].bData); } // actually use the bitmap data function showImage(bitmapdata) { var data:BitmapData = bitmapdata; var bitmap:Bitmap = new Bitmap(data); this.addChild(bitmap); // add graphic to stage (inside this) if(w!=0) bitmap.width=w; if(h!=0) bitmap.height=h; } } }