Using Flashdevelop, I managed to add a a jpg in my starling project:

[Embed(source = "../../../../lib/table_org_img_retouched_900.png")]
        private static const Graphic:Class;

...

// create a Bitmap object out of the embedded image
var sausageBitmap:Bitmap = new Sausage();

            // create a Texture object to feed the Image object
            var texture:Texture = Texture.fromBitmap(sausageBitmap);

            // create a Image object with our one texture
            var image:Image = new Image(texture);

            //image.width = 1000;

            // show it
            addChild(image);

what I get at the end is this:

https://www.dropbox.com/s/wvqws29tg3sxwzv/starling.png

Why is my png cut off?

有帮助吗?

解决方案

It is possible that when you started starling your stage size was not accurate ,

_starling = new Starling(Game, stage);
_starling.start();

I suggest you trace the size of the stage you pass to Starling in the creation, if it is not aligned with your device size then you should delay a bit the creation of Starling.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top