mirror of https://github.com/axmolengine/axmol.git
77 lines
2.3 KiB
Plaintext
77 lines
2.3 KiB
Plaintext
|
|
enum {
|
|
TMXLayerAttribNone = 1 << 0,
|
|
TMXLayerAttribBase64 = 1 << 1,
|
|
TMXLayerAttribGzip = 1 << 2,
|
|
TMXLayerAttribZlib = 1 << 3,
|
|
};
|
|
|
|
enum {
|
|
TMXPropertyNone,
|
|
TMXPropertyMap,
|
|
TMXPropertyLayer,
|
|
TMXPropertyObjectGroup,
|
|
TMXPropertyObject,
|
|
TMXPropertyTile
|
|
};
|
|
|
|
typedef enum ccTMXTileFlags_ {
|
|
kCCTMXTileHorizontalFlag = 0x80000000,
|
|
kCCTMXTileVerticalFlag = 0x40000000,
|
|
kCCTMXTileDiagonalFlag = 0x20000000,
|
|
kCCFlipedAll = (kCCTMXTileHorizontalFlag|kCCTMXTileVerticalFlag|kCCTMXTileDiagonalFlag),
|
|
kCCFlippedMask = ~(kCCFlipedAll)
|
|
} ccTMXTileFlags;
|
|
|
|
class CCTMXLayerInfo : public CCObject
|
|
{
|
|
CCDictionary* getProperties();
|
|
void setProperties(CCDictionary* pval);
|
|
};
|
|
|
|
class CCTMXTilesetInfo : public CCObject
|
|
{
|
|
CCRect rectForGID(unsigned int gid);
|
|
};
|
|
|
|
class CCTMXMapInfo : public CCObject
|
|
{
|
|
void setOrientation(int val);
|
|
int getOrientation();
|
|
void setMapSize(CCSize sz);
|
|
CCSize getMapSize();
|
|
void setTileSize(CCSize sz);
|
|
CCSize getTileSize();
|
|
void setLayers(CCArray* pval);
|
|
CCArray* getLayers();
|
|
void setTilesets(CCArray* pval);
|
|
CCArray* getTilesets();
|
|
void setObjectGroups(CCArray* val);
|
|
CCArray* getObjectGroups();
|
|
void setParentElement(int val);
|
|
int getParentElement();
|
|
void setParentGID(unsigned int val);
|
|
unsigned int getParentGID();
|
|
void setLayerAttribs(int val);
|
|
int getLayerAttribs();
|
|
void setStoringCharacters(bool val);
|
|
bool isStoringCharacters() const;
|
|
void setProperties(CCDictionary* pval);
|
|
CCDictionary* getProperties();
|
|
void setTileProperties(CCDictionary* tileProperties);
|
|
CCDictionary* getTileProperties();
|
|
void setCurrentString(const char *currentString);
|
|
const char* getCurrentString();
|
|
void setTMXFileName(const char *fileName);
|
|
const char* getTMXFileName();
|
|
|
|
void startElement(void *ctx, const char *name, const char **atts);
|
|
void endElement(void *ctx, const char *name);
|
|
void textHandler(void *ctx, const char *ch, int len);
|
|
bool parseXMLFile(const char *xmlFilename);
|
|
bool parseXMLString(const char *xmlString);
|
|
|
|
static CCTMXMapInfo* create(const char *tmxFile);
|
|
static CCTMXMapInfo* createWithXML(const char* tmxString, const char* resourcePath);
|
|
};
|