title: How can I optimize my BitmapTextureAtlas in AndEngine?
body: <p>Currently I have 4 different images that I am loading into 4 seperate BitmapTextureAtlas's. 
  What I would like to do is load 4 different images inside 1 BitMapTextureAtlas to try and optimize speed. I have edited the code to what I believe should have made it work however when this (Live wallpaper) loads the texture, the screen is just white. Here is what I have done so far:</p>
  
  <p><strong>onLoadResources()</strong></p>
  
  <p>Original BitmapTextureAtlas:</p>
  
  <pre><code>this.StarsAtlas = new BitmapTextureAtlas(1024, 1024, TextureOptions.DEFAULT);   
  this.SpaceAtlas = new BitmapTextureAtlas(1024, 1024, TextureOptions.DEFAULT);
  this.CloudsAtlas = new BitmapTextureAtlas(1024, 1024, TextureOptions.DEFAULT);
  this.SunetAtlas = new BitmapTextureAtlas(1024, 512, TextureOptions.DEFAULT);
  </code></pre>
  
  <p>I have condensed to:</p>
  
  <pre><code>this.skyAtlas = new BitmapTextureAtlas(1024, 4096, TextureOptions.BILINEAR);
  </code></pre>
  
  <p>Original Texture Regions:</p>
  
  <pre><code>    this.LayerStars = BitmapTextureAtlasTextureRegionFactory 
              .createFromAsset(this.StarsAtlas, this,
                      "stars.jpg", 0, 0); //568x518
      this.LayerSpace = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.SpaceAtlas, this,
                      "space.jpg", 0, 0); //500x800
      this.LayerClouds = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.CloudsAtlas, this,
                      "clouds.jpg", 0, 0); //600x478
      this.LayerSunset = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.SunsetAtlas, this,
                      "sunset.jpg", 0, 0); //997x460
  </code></pre>
  
  <p>I have changed to:</p>
  
  <pre><code>    this.LayerStars = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.skyAtlas, this,
                      "stars.jpg", 0, 0); //568x518
      this.LayerSpace = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.skyAtlas, this,
                      "space.jpg", 0, 518); //500x800
      this.LayerClouds = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.skyAtlas, this,
                      "clouds.jpg", 0, 1318); //600x478
      this.LayerSunset = BitmapTextureAtlasTextureRegionFactory
              .createFromAsset(this.skyAtlas, this,
                      "sunset.jpg", 0, 1796); //997x460
  </code></pre>
  
  <p>Loading the texture:</p>
  
  <pre><code>this.mEngine.getTextureManager().loadTexture(
              this.skyAtlas);
  </code></pre>
  
  <p>...Later on in the <strong>onLoadScene()</strong>
  This stays the same:</p>
  
  <pre><code>    Sprite starSprite = new Sprite(0, 0, 568, 518, this.LayerStars);
      Sprite cloudSprite = new Sprite(0, 0, 600, 478, this.LayerClouds);
      Sprite spaceSprite = new Sprite(0, 0, 500, 800, this.LayerSpace);
      Sprite sunsetSprite = new Sprite(0, 0, 997, 460, this.LayerSunset);
  </code></pre>
  
  <p>Any idea what could be causing the white screen?
  On a side note, it loaded fine when I had 4 different images in 4 separate BitmapTextureAtlas's.</p>