TileMap issues on Android

TileMap issues on Android
0.0 0



I have been having quite a bit of trouble with the TileMaps on Samsung Galaxy S (or a simulator with an identical screen resolution).

If I enable view->create(480, 320); in main.cpp the screen looks like in screenshot 320a. Once I perform an action that would force the OS to display something on screen (such as locking, the device, holding down the power button and then dismissing it), the screen will turn in what you see in screenshot 320b

If I disable the scaling I get a similar effect, see screenshots 480a and 480b.

The same project files work flawlessly on iPhone.

I also attached the project files for Android and iPhone.

I am using cocos2d-x 1.0.1. Any idea why this is happening?

320a.png (121.9 KB)

320b.png (344.4 KB)

480a.png (108.4 KB)

480b.png (354.7 KB)

TileTest.zip (20737.9 KB)


Yes, it is true on andorid, and now we don’t know why it happened. You can reproduce it by moving the tilemap too.


I filled in the gaps in the tilemap with a red color to see if it affects in any way the black artifacts on the screen.

Sure enough, the artifacts turned red, so this leads me to believe that the stripes we see on screen are because of a rounding error/precision on the Android platform.

If you look at the 480b screenshot you can see that the artifacts have a radial shape, which is even weirder.

I am wondering why the tests supplied with the Cocos2D-x work as expected. The most obvious idea is that the tests work because the 1px spacing between the tiles is transparent.

Anyway, this all leads me to believe that the code that slices out a piece of the tilemap is imprecise on the Android platform, although as far as I looked I could not find code that seemed to be specific for it with regard to tilemaps, which makes it even harder to debug/fix.

Hope this helps anyone who is daring enough to try tackle the problem :slight_smile:


Is there currently any plans to resolve this issue?