Repeating (menu) background in HaxeFlixel?

517 views Asked by At

I've tried to load a 16x16 image as a FlxSprite, but I don't know how to make it repeat to span across the whole Window. How would I do that?

Where I load the sprite:

class MainMenuState extends FlxState {
  var _menuBg:FlxSprite;
  override public function create ():Void {
    _menuBg = new FlxSprite(16, 16, 'assets/img/block1_16.png');
    add(_menuBg);
    super.create();
 }

 override public function destroy ():Void {
   super.destroy();
 }

 override public function update ():Void {
   super.update();
 }
}
1

There are 1 answers

0
Gama11 On BEST ANSWER

You can use a FlxBackdrop (from flixel-addons) for that.