Hello. I’m using TMXTiledMap
object using ::createWithXML()
and passing this mock into that function
return
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<map version=\"1.0\" tiledversion=\"1.1.0\" orientation=\"orthogonal\" renderorder=\"right-down\" width=\"32\" height=\"32\" tilewidth=\"16\" tileheight=\"16\" infinite=\"1\" nextlayerid=\"2\" nextobjectid=\"1\">"
" <tileset firstgid=\"1\" name=\"spritesheet_16\" tilewidth=\"16\" tileheight=\"16\" tilecount=\"3\" columns=\"3\">"
" <image source=\"spritesheet_16.png\" width=\"48\" height=\"16\"/>"
" </tileset>"
" <layer id=\"1\" name=\"Tile Layer 1\" width=\"16\" height=\"16\">"
" <data encoding=\"csv\">"
// "<chunk x=\"0\" y=\"0\" width=\"16\" height=\"16\">2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</chunk>"
// "<chunk x=\"16\" y=\"0\" width=\"16\" height=\"16\">1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</chunk>"
" </data>"
" </layer>"
"</map>"
;
So, data is empty but here is what I see in the game
If I add something like this
"<chunk x=\"0\" y=\"0\" width=\"16\" height=\"16\">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</chunk>"
(With random count of zeros not equal to chunk.height * chunk.width)
The picture differs drastically
If I uncomment first chunk (the most top of two commented lines) I see that
But if I uncomment both chunks I expect two squares like above with different tile type in each. Here is what I see
Weird tile at the bottom right and no chunk to the right of the first one
My tileset:
What’s wrong with me or with cocos or with TMX plugin?
P.S. Red triangle is my character. Don’t pay attention on it and chunk position in each frame
I also noticed that if I just remove these commented lines there will be the first image but with another types of tiles in the same positions
This issue occurs only with infinite/chunked maps. Fixed map of any size works fine