@@ -47,56 +47,58 @@ namespace cocos2d {
47
47
CCTMXOrientationIso,
48
48
};
49
49
50
- /* * CCTMXTiledMap knows how to parse and render a TMX map.
51
-
52
- It adds support for the TMX tiled map format used by http://www.mapeditor.org
53
- It supports isometric, hexagonal and orthogonal tiles.
54
- It also supports object groups, objects, and properties.
55
-
56
- Features:
57
- - Each tile will be treated as an CCSprite
58
- - Each tile can be rotated / moved / scaled / tinted / "opacitied"
59
- - Tiles can be added/removed in runtime
60
- - The z-order of the tiles can be modified in runtime.
61
- - Each tile has an anchorPoint of (0,0)
62
- - The anchorPoint of the TMXTileMap is (0,0)
63
- - The TMX layers will be added as a child
64
- - The TMX layers will be aliased by default
65
- - The tileset image will be loaded using the TextureMgr
66
- - Each tile will have a unique tag
67
- - Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z
68
- - Each object group will be treated as an NSMutableArray
69
- - Objects can be created using your own classes or a generic object class which will contain all the properties in a dictionary
70
- - Properties can be assigned to the Map, Layer, Object Group, and Object
71
-
72
- Limitations:
73
- - It only supports one tileset per layer.
74
- - Embeded images are not supported
75
- - It only supports the XML format (the JSON format is not supported)
76
-
77
- Technical description:
78
- Each layer is created using an TMXLayer (subclass of CCSpriteSheet). If you have 5 layers, then 5 TMXLayer will be created,
79
- unless the layer visibility is off. In that case, the layer won't be created at all.
80
- You can obtain the layers (TMXLayer objects) at runtime by:
81
- - [map getChildByTag: tag_number]; // 0=1st layer, 1=2nd layer, 2=3rd layer, etc...
82
- - [map layerNamed: name_of_the_layer];
83
-
84
- Each object group is created using a TMXObjectGroup which is a subclass of NSMutableArray.
85
- You can obtain the object groups at runtime by:
86
- - [map objectGroupNamed: name_of_the_object_group];
87
-
88
- Each object is a TMXObject.
89
-
90
- Each property is stored as a key-value pair in an NSMutableDictionary.
91
- You can obtain the properties at runtime by:
92
-
93
- [map propertyNamed: name_of_the_property];
94
- [layer propertyNamed: name_of_the_property];
95
- [objectGroup propertyNamed: name_of_the_property];
96
- [object propertyNamed: name_of_the_property];
97
-
98
- @since v0.8.1
99
- */
50
+ /* * CCTMXTiledMap knows how to parse and render a TMX map.
51
+
52
+ It adds support for the TMX tiled map format used by http://www.mapeditor.org
53
+ It supports isometric, hexagonal and orthogonal tiles.
54
+ It also supports object groups, objects, and properties.
55
+
56
+ Features:
57
+ - Each tile will be treated as an CCSprite
58
+ - The sprites are created on demand. They will be created only when you call "[layer tileAt:]"
59
+ - Each tile can be rotated / moved / scaled / tinted / "opacitied", since each tile is a CCSprite
60
+ - Tiles can be added/removed in runtime
61
+ - The z-order of the tiles can be modified in runtime
62
+ - Each tile has an anchorPoint of (0,0)
63
+ - The anchorPoint of the TMXTileMap is (0,0)
64
+ - The TMX layers will be added as a child
65
+ - The TMX layers will be aliased by default
66
+ - The tileset image will be loaded using the CCTextureCache
67
+ - Each tile will have a unique tag
68
+ - Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z
69
+ - Each object group will be treated as an NSMutableArray
70
+ - Object class which will contain all the properties in a dictionary
71
+ - Properties can be assigned to the Map, Layer, Object Group, and Object
72
+
73
+ Limitations:
74
+ - It only supports one tileset per layer.
75
+ - Embeded images are not supported
76
+ - It only supports the XML format (the JSON format is not supported)
77
+
78
+ Technical description:
79
+ Each layer is created using an CCTMXLayer (subclass of CCSpriteSheet). If you have 5 layers, then 5 CCTMXLayer will be created,
80
+ unless the layer visibility is off. In that case, the layer won't be created at all.
81
+ You can obtain the layers (CCTMXLayer objects) at runtime by:
82
+ - [map getChildByTag: tag_number]; // 0=1st layer, 1=2nd layer, 2=3rd layer, etc...
83
+ - [map layerNamed: name_of_the_layer];
84
+
85
+ Each object group is created using a CCTMXObjectGroup which is a subclass of NSMutableArray.
86
+ You can obtain the object groups at runtime by:
87
+ - [map objectGroupNamed: name_of_the_object_group];
88
+
89
+ Each object is a CCTMXObject.
90
+
91
+ Each property is stored as a key-value pair in an NSMutableDictionary.
92
+ You can obtain the properties at runtime by:
93
+
94
+ [map propertyNamed: name_of_the_property];
95
+ [layer propertyNamed: name_of_the_property];
96
+ [objectGroup propertyNamed: name_of_the_property];
97
+ [object propertyNamed: name_of_the_property];
98
+
99
+ @since v0.8.1
100
+ */
101
+
100
102
class CCX_DLL CCTMXTiledMap : public CCNode
101
103
{
102
104
/* * the map's size property measured in tiles */
0 commit comments