接上一章《Cocos2d-x源码解析(1)——地图模块(2)》
通过前面两章的分析,我们可以知道cocos将tmx的信息结构化到 CCTMXMapInfo,CCTMXTilesetInfo,CCTMXLayerInfo之中。
其中CCTMXMapInfo存储地图的信息包扩以下几块信息:
- Map orientation (hexagonal, isometric or orthogonal)
- Tile size
- Map size
- Layers (an array of TMXLayerInfo objects)
- Tilesets (an array of TMXTilesetInfo objects)
- ObjectGroups (an array of TMXObjectGroupInfo objects)
CCTMXTilesetInfo存储瓦片信息包括:
- Tileset name
- Tileset spacing
- Tileset margin
- size of the tiles
- Image used for the tiles
- Image size
CCTMXLayerInfo存储层的信息包括: