Android with Tiled tmx and cocos 2d renders corrupted images

153 Views Asked by At

I'm trying to show a map created with Tiled map editor using Cocos2d in an android game, but all tiles get corrupted I cannot add the image 'cause I don't have the reputation to do so. Do you have any idea why this is happening and how to solve this issue? The tiles appear but the color is screwed up, showing color gradients instead of a fixed color. Thanks! Pedro Zuppelli

1

There are 1 best solutions below

0
On

Add this code in your activity from where you are starting cocos 2d scene.

CCGLSurfaceView surfaceView;
surfaceView = new CCGLSurfaceView(GameStartActivity.this);
surfaceView.setEGLConfigChooser(8, 8, 8, 8, 0, 0);
surfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
setContentView(surfaceView);