Pregunta

I'm having some issues with image rendering on Android. I can see the game correctly in my Desktop build and also in the Android Emulator but when it comes to a real Android device nothing is painted.

Objects are there because if I click on the button I can't see the action is performed, I can hear sounds and see BitmapFonts painted correctly.

The problem happens with images painted as textures with spritebatcher or Actors (Image for instance).

Any ideas? Thanks in advance.

In Assets Class:

public static void texturePacker(){
        if(S.DEBUG){
            Settings settings = new Settings();
            settings.maxWidth = 16384;
            settings.maxHeight = 16384;
            settings.jpegQuality = (float) 0.7;

            TexturePacker2.process(settings, "imgs/res", "imgs/packs","pack");
        }
    }

public static void loadGameAssets() {

        //Cargo todas las texturas del menu
        enemy_punch_static=atlas.findRegion("punch_static");
        enemy_punch_punyo1=atlas.findRegion("punch_punyo1");
...
}

In a Screen implementing class:

...
    Image countdown_go=new Image(Assets.countdown_go);
stage.addActor(countdown_go);
...
@Override
    public void render(float delta) {
        super.render();

        Gdx.gl.glClear(Gdx.gl.GL_COLOR_BUFFER_BIT | Gdx.gl.GL_DEPTH_BUFFER_BIT);
        Gdx.gl.glClearColor(0.18431f,0.647058f,0.878431f, 1);
        stage.act(delta);
        stage.draw();
    }
¿Fue útil?

Solución

You can't use 16kx16k textures on devices. You can query GL_MAX_TEXTURE on all the devices you want to support to see if you can get away with something like 2048x2048 but you might want to switch to 1024x1024 to play it safe.

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