-
-
Save starpause/2004394 to your computer and use it in GitHub Desktop.
How to display a bitmap (NME recipe)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import nme.display.Bitmap; | |
import nme.display.Sprite; | |
import nme.Assets; | |
import nme.Lib; | |
/** | |
* @author Joshua Granick | |
*/ | |
class DisplayingABitmap extends Sprite { | |
public function new () { | |
super (); | |
//use Assets.getBitMapData if .getAsset results in nme.installer.#Assets has no field getAsset | |
var logo = new Bitmap (Assets.getAsset ("assets/nme.png")); | |
addChild (logo); | |
} | |
public static function main () { | |
Lib.current.addChild (new DisplayingABitmap ()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment