New issue
 Projects > js > Issues > Feature #3733

Add getLayers()?

Feature #3733 [Closed]
ZippoLag 2014-01-16 15:50 . Updated almost 3 years ago

Hi, I’ve encountered some scenarios working with TMXTiledMaps in which I would find useful to have a list of all layer names (and/or all the TMXLayers) associated with a map, but I don’t see any method or public property for accessing such a list.

If I’m not the only one that needs this, could it be implemented? (I can work around that limitation, and I’m the one designing the maps on Tiled, so it’s not a big deal if it doesn’t get implemented).

ludingping 2014-01-17 02:18


I think we should add a “allLayers” function to cc.TMXTiledMap, although this function equals “this.getChildren();”.

Thanks for your suggest

ludingping 2014-01-17 02:37
  • Assignee set to ludingping
ZippoLag 2014-01-17 03:10

Note that it would only equal getChildren if you don’t add anything else, but sometimes it’s usefull to add other children than layers to TMXTiledMaps (for example, I add characters, since I can work easier with the coordinate system if I put them there instead of in another layer).

ludingping 2014-01-17 03:24

Yes, I see.

Thanks for noticing.:)

ludingping 2014-01-21 05:49
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Atom PDF

Start date:2014-01-16
Due date:
% Done:


Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.