AS3IsoLib New IsoSprite
- by KoopaTroopa
I'm following a guide (http://www.jsparrowhawk.com/blog/?p=75) on how to use the As3IsoLib library. It seems his examples are a little erroneous at times. I'm at the part of creating a sprite, assigning it an image and then rendering. When I test my application I get my box and grid but not the sprite.
var mySprite:IsoSprite;
mySprite = new IsoSprite();
mySprite.setSize(40, 40, 0);
mySprite.moveTo(120, 40, 0);
scene.addChild(mySprite);
var myImgLoader:Loader = new Loader();
var myImgURL:URLRequest = new URLRequest("http://www.jsparrowhawk.com/blog/wp-content/uploads/2011/10/as3isolib_styling_6b.jpg");
myImgLoader.load(myImgURL);
myImgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadComplete);
function imgLoadComplete(e:Event):void
{
var myImg:Bitmap = new Bitmap(e.target.content.bitmapData);
mySprite.sprites = [myImg];
scene.render();
}