0

I am trying to create a background image for a main menu using a Sprite.

attachChild(new Sprite(0, 0, resourcesManager.menu_background_region, vbom));

The line above is my call to attach the sprite to the scene. menu_background_region is my ITextureRegion declared and initialized in my ResourcesManager class.

BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
menu_background_region = BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTextureAtlas, activity, "menubackground.png");
 try
   {
       this.menuTextureAtlas.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
       this.menuTextureAtlas.load();
   }
   catch (final TextureAtlasBuilderException e)
   {
       Debug.e(e);
   }

My file path is declared and correct because it does load my buttons for my menu scene, but for some reason I cannot get the background image to be loaded correctly Any help would be greatly appreciated.

Jared
  • 394
  • 4
  • 15

1 Answers1

0

maybe your atlas is to small, to save the sprite/picture?

menuTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
                                                                         ^     ^

if you initilazied it with 256,256 then it can be to small. just increase this to 1024,1024

Izu
  • 235
  • 1
  • 5