I have a class I am importing into main that looks like this:
import openfl.display.Sprite;
class Game extends Sprite {
...
public function makeMap(){
var mapImage = Assets.getBitmapData('assets/img/map.png');
mapBackground = new Bitmap(mapImage);
playMap = new Sprite();
playMap.addChild(mapBackground);
addChild(playMap);
playMap.y =0;
playMap.x=0;
}
}
I am unable to add the sprite to the stage. From what I have read this should work but it does not render to the screen. Someone please help.