1

sorry if this issue's been asked before but I couldn't find a reference to it, trying to start using andEngine and I'm trying to use an image 3360x720, because it's tiled with 7 columns. I've tried this method:

// Initialize the background
this.mBackgroundTexture = new Texture(4096, 1024, TextureOptions.BILINEAR);
this.mEngine.getTextureManager().loadTextures(this.mBackgroundTexture);
this.mBackgroundRegion = TextureRegionFactory.createTiledFromAsset(this.mBackgroundTexture, this, "back_anim_tiled.png", 0, 0, 7, 1);// 3360x720
this.mBackground = new AnimatedSprite(0, 0, 480, 720, this.mBackgroundRegion);

Now all I get is a white screen when I animate, and attach it to the scene? Is the texture simply too big for this operation, and if so, what should I do for a simple small animation such as a lightning bolt appearing for a second? I would like this to be an actual animatedSprite rather than me actually manually setting the background image.. any help would be appreaciated, thank you

[new information] I'm almost positive it has something to do with the size that each phone can handle. I've tested this out by resizing my image to 1024x720, 2048x720, and again to 4096x720. Kept my sprite size the same as 480x720 (camera size) and it worked just fine for any number of columns for the first two, but the 4096px simply shows the white screen. Oh well, if someone finds a way around this please let me know, as for now I'll probably just manually adjust my "animation" src image manually.

I've since found that when your texture gets above 1024x1024 you run the risk of it not being displayed, assuming each phone is different with this. So instead I'm simply slowing down the framerate a bunch and using a smaller image to tile from.

While-E
  • 1,527
  • 2
  • 20
  • 37
  • I've since found that when your texture gets above 1024x1024 you run the risk of it not being displayed, assuming each phone is different with this. So instead I'm simply slowing down the framerate a bunch and using a smaller image to tile from. – While-E Apr 27 '11 at 04:37

1 Answers1

0

I have experienced a similar issue where there seems to be a random limit on the size of very large textures. I use backgrounds for my game with Textures that are 1024 x 1024 in size and it seemed that if I tried to have 4 or more displayed the last to be added would simply show up as white.

Sorry I can't offer any actual help, but definitely don't stress about it because you and I are not the first to have this problem and I think it's one of those things that Nicolas will be ironing out in Andengine.

Sam Stern
  • 24,624
  • 13
  • 93
  • 124
  • no worries here: Nicolas is the man. I figured out through quite a bit of research that just about every phone is going to have a different limitation on memory and thus texture size: therefore must program with this in mind. – While-E Jun 26 '11 at 18:20