# Multiple tileset bug in cocos2d-x

**URL:** <https://discourse.mapeditor.org/t/multiple-tileset-bug-in-cocos2d-x/140>\
**Category:** Questions\
**Created:** [January 6, 2015, 12:41pm UTC](https://discourse.mapeditor.org/t/multiple-tileset-bug-in-cocos2d-x/140 "2015-01-06T12:41:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanana0501](https://avatars.discourse-cdn.com/v4/letter/h/ee59a6/32.png) [@hanana0501](https://discourse.mapeditor.org/u/hanana0501)\
**Post date:** [January 6, 2015, 12:41pm UTC](https://discourse.mapeditor.org/t/multiple-tileset-bug-in-cocos2d-x/140/1 "2015-01-06T12:41:22Z")

</div>

cocos2d-x 3.3  
tiled map editor 0.10.2  
iOS8.1

i put on tiles in a layer from multiple tile set,  
so iOS device displayed only one side of tile set.  
is this bug, or specification?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [January 6, 2015, 1:19pm UTC](https://discourse.mapeditor.org/t/multiple-tileset-bug-in-cocos2d-x/140/2 "2015-01-06T13:19:12Z")

</div>

It’s a shortcoming of cocos2d-x that it doesn’t support one layer to use tiles from different tilesets. In my opinion it’s a bit of a lazy omission, but for good rendering speed using only one tileset per layer does make sense since it avoids relatively expensive context switching and allows batching the entire layer as one draw call.

On the Tiled side, there is currently no way to enforce this one tileset limit. The following issue has been open about this for years, since the problem already came up in cocos2d-iphone:

> <https://github.com/bjorn/tiled/issues/153>
>
> Cocos2d only allows one tileset per tile layer. It is very easy to accidentally click the tile stamp tool on the...

  
.

---

<div class="post-metadata">

**Author:** ![hanana0501](https://avatars.discourse-cdn.com/v4/letter/h/ee59a6/32.png) [@hanana0501](https://discourse.mapeditor.org/u/hanana0501)\
**Post date:** [January 7, 2015, 2:06am UTC](https://discourse.mapeditor.org/t/multiple-tileset-bug-in-cocos2d-x/140/3 "2015-01-07T02:06:36Z")

</div>

thx to reply!  
so it is cocos2d-x’s specification.  
to be honest, designer of my project make many tile set.(i don’t know why she does that)  
we sighed and it doesn’t work.  
maybe she doesn’t know idea of drawCall and spritesheet  
in the first place, i should tell that idea to her. it’s my fault.

continuously, we use tiledMapEditor and make game.  
thx to develop good tool.
