2011-06-14 14:31:25 +08:00
|
|
|
namespace cocos2d {
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/** Orthogonal orientation */
|
|
|
|
CCTMXOrientationOrtho,
|
|
|
|
|
|
|
|
/** Hexagonal orientation */
|
|
|
|
CCTMXOrientationHex,
|
|
|
|
|
|
|
|
/** Isometric orientation */
|
|
|
|
CCTMXOrientationIso,
|
|
|
|
};
|
|
|
|
|
2011-08-02 16:21:23 +08:00
|
|
|
|
2011-06-14 14:31:25 +08:00
|
|
|
class CCTMXTiledMap : public CCNode
|
|
|
|
{
|
2011-08-02 16:21:23 +08:00
|
|
|
/** the map's size property measured in tiles */
|
|
|
|
CCSize getMapSize();
|
2011-06-14 14:31:25 +08:00
|
|
|
void setMapSize(CCSize sz);
|
2011-08-02 16:21:23 +08:00
|
|
|
/** the tiles's size property measured in pixels */
|
|
|
|
CCSize getTileSize();
|
2011-06-14 14:31:25 +08:00
|
|
|
void setTileSize(CCSize sz);
|
2011-08-02 16:21:23 +08:00
|
|
|
/** map orientation */
|
|
|
|
int getMapOrientation();
|
2011-06-14 14:31:25 +08:00
|
|
|
void setMapOrientation(int val);
|
|
|
|
/** object groups */
|
2011-08-02 16:21:23 +08:00
|
|
|
|
|
|
|
CCMutableArray<CCTMXObjectGroup*>* getObjectGroups();
|
2011-06-14 14:31:25 +08:00
|
|
|
void setObjectGroups(CCMutableArray<CCTMXObjectGroup*>* pval);
|
2011-08-02 16:21:23 +08:00
|
|
|
/** properties */
|
|
|
|
CCStringToStringDictionary* getProperties();
|
2011-06-14 14:31:25 +08:00
|
|
|
void setProperties(CCStringToStringDictionary* pval);
|
|
|
|
|
|
|
|
CCTMXTiledMap();
|
|
|
|
~CCTMXTiledMap();
|
|
|
|
|
|
|
|
/** creates a TMX Tiled Map with a TMX file.*/
|
|
|
|
static CCTMXTiledMap * tiledMapWithTMXFile(const char *tmxFile);
|
|
|
|
|
|
|
|
/** initializes a TMX Tiled Map with a TMX file */
|
|
|
|
bool initWithTMXFile(const char *tmxFile);
|
|
|
|
|
|
|
|
/** return the TMXLayer for the specific layer */
|
|
|
|
CCTMXLayer* layerNamed(const char *layerName);
|
|
|
|
|
|
|
|
/** return the TMXObjectGroup for the secific group */
|
|
|
|
CCTMXObjectGroup* objectGroupNamed(const char *groupName);
|
|
|
|
|
|
|
|
/** return the value for the specific property name */
|
|
|
|
CCString *propertyNamed(const char *propertyName);
|
|
|
|
|
|
|
|
/** return properties dictionary for tile GID */
|
|
|
|
CCDictionary<std::string, CCString*> *propertiesForGID(int GID);
|
|
|
|
|
|
|
|
};
|
2011-08-02 16:21:23 +08:00
|
|
|
|
|
|
|
}// namespace cocos2d
|
|
|
|
|
|
|
|
|
|
|
|
|