Problema para cargar una imagen de fondo grande en el dispositivo (AndEngine)

StackOverflow https://stackoverflow.com/questions/6813670

  •  25-10-2019
  •  | 
  •  

Pregunta

Al cargar en el dispositivo, solo la pantalla de imagen blanca, al cargar el emulador, las imágenes están rotas

Código de muestra:

// this.mcamera = nueva cámara (0, 0, 480,320);

    final Engine engine = new Engine(new EngineOptions(true, 

Screenientation.landscape, new FillResolutionPolicy (), this.mcamera));

this.mcamera = nueva cámara (0, 0, cámara_width, cámaras_height);

    final Engine engine = new Engine(new EngineOptions(true, 

Screenientation.landscape, new FillResolutionPolicy (), this.mcamera));

//----

this.mTexture = New Texture (2048, 512, TextureOptions.bilineal_premultiplyalpha); this.mbgTextureRegion = TextureRegionFactory.CreateFromasset (this.mtexture, this, "GFX/BG.PNG", 0, 0);

        this.mEngine.getTextureManager().loadTexture(this.mTexture);

¿Cuál es el tamaño máximo de la textura en AndEngine? Usé 2048, es un problema, ¿por favor ayuda?

¿Fue útil?

Solución

El tamaño máximo de textura depende del dispositivo. Solo los dispositivos más nuevos admiten 2048x2048. En mi experiencia, 1024x1024 son mejor apoyados a partir de hoy.

También es posible encontrar el tamaño máximo en tiempo de ejecución:¿Cómo puedo encontrar el tamaño máximo de textura para diferentes teléfonos?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top