Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

Texture.fromEmbeddedAsset() should allow the Class to instantiate BitmapData too #1011

Closed joshtynjala closed 6 years ago

joshtynjala commented 6 years ago

An image file embedded with [Embed] metadata instantiates a flash.display.Bitmap. In Animate CC, if you add an image file to the library and set "Export for ActionScript", the symbol will be exported as a class that extends flash.display.BitmapData instead.

I recommended someone use Texture.fromEmbeddedAsset() in this thread, but it turned out that they couldn't do that because a symbol from Animate's library extended BitmapData instead of Bitmap.

PrimaryFeather commented 6 years ago

Thanks a lot for making me aware of this, Josh! Indeed, the method has to support this. It should now work as expected.