AS3IsoLib New IsoSprite

Posted by KoopaTroopa on Stack Overflow See other posts from Stack Overflow or by KoopaTroopa
Published on 2012-10-27T22:56:22Z Indexed on 2012/10/27 23:00 UTC
Read the original article Hit count: 176

Filed under:
|

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();
        }

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about isometric