cocos2d-x  2.2.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCTMXMapInfo Class Reference

CCTMXMapInfo contains the information about the map like: More...

#include <CCTMXXMLParser.h>

Inheritance diagram for CCTMXMapInfo:
CCObject CCSAXDelegator CCCopying

Public Member Functions

virtual const CCSize & getMapSize (void)
 getMapSize More...
 
virtual void setMapSize (const CCSize &var)
 set# MapSize More...
 
virtual const CCSize & getTileSize (void)
 getTileSize More...
 
virtual void setTileSize (const CCSize &var)
 set# TileSize More...
 
virtual CCArray * getLayers (void)
 getLayers More...
 
virtual void setLayers (CCArray *var)
 setLayers More...
 
virtual CCArray * getTilesets (void)
 getTilesets More...
 
virtual void setTilesets (CCArray *var)
 setTilesets More...
 
virtual CCArray * getObjectGroups (void)
 getObjectGroups More...
 
virtual void setObjectGroups (CCArray *var)
 setObjectGroups More...
 
virtual CCDictionary * getProperties (void)
 getProperties More...
 
virtual void setProperties (CCDictionary *var)
 setProperties More...
 
 CCTMXMapInfo ()
virtual ~CCTMXMapInfo ()
bool initWithTMXFile (const char *tmxFile)
 initializes a TMX format with a tmx file More...
 
bool initWithXML (const char *tmxString, const char *resourcePath)
 initializes a TMX format with an XML string and a TMX resource path More...
 
bool parseXMLFile (const char *xmlFilename)
 initializes parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file More...
 
bool parseXMLString (const char *xmlString)
CCDictionary * getTileProperties ()
void setTileProperties (CCDictionary *tileProperties)
void startElement (void *ctx, const char *name, const char **atts)
 implement pure virtual methods of CCSAXDelegator More...
 
void endElement (void *ctx, const char *name)
void textHandler (void *ctx, const char *ch, int len)
const char * getCurrentString ()
void setCurrentString (const char *currentString)
const char * getTMXFileName ()
void setTMXFileName (const char *fileName)
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObject * autorelease (void)
CCObject * copy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
virtual void update (float dt)
- Public Member Functions inherited from CCCopying
virtual CCObject * copyWithZone (CCZone *pZone)

Static Public Member Functions

static CCTMXMapInfo * formatWithTMXFile (const char *tmxFile)
 creates a TMX Format with a tmx file More...
 
static CCTMXMapInfo * formatWithXML (const char *tmxString, const char *resourcePath)
 creates a TMX Format with an XML string and a TMX resource path More...
 

Public Attributes

virtual int getOrientation (void)\n\n public
 getOrientation More...
 
virtual int getParentElement (void)\n\n public
 getParentElement More...
 
virtual unsigned int getParentGID (void)\n\n public
 getParentGID More...
 
virtual int getLayerAttribs (void)\n\n public
 getLayerAttribs More...
 
virtual bool getStoringCharacters (void)\n\n public
 getStoringCharacters More...
 
- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Protected Attributes

int m_nOrientation
 map orientation More...
 
CCSize m_tMapSize
 map width & height More...
 
CCSize m_tTileSize
 tiles width & height More...
 
CCArray * m_pLayers
 Layers. More...
 
CCArray * m_pTilesets
 tilesets More...
 
CCArray * m_pObjectGroups
 ObjectGroups. More...
 
int m_nParentElement
 parent element More...
 
unsigned int m_uParentGID
 parent GID More...
 
int m_nLayerAttribs
 layer attribs More...
 
bool m_bStoringCharacters
 is storing characters? More...
 
CCDictionary * m_pProperties
 properties More...
 
std::string m_sTMXFileName
 tmx filename More...
 
std::string m_sResources
std::string m_sCurrentString
 current string More...
 
CCDictionary * m_pTileProperties
 tile properties More...
 
unsigned int m_uCurrentFirstGID
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Detailed Description

CCTMXMapInfo contains the information about the map like:

  • Map orientation (hexagonal, isometric or orthogonal)
  • Tile size
  • Map size

And it also contains:

  • Layers (an array of TMXLayerInfo objects)
  • Tilesets (an array of TMXTilesetInfo objects)
  • ObjectGroups (an array of TMXObjectGroupInfo objects)

This information is obtained from the TMX file.

Constructor & Destructor Documentation

virtual ~CCTMXMapInfo ( )
virtual

Member Function Documentation

void endElement ( void *  ctx,
const char *  name 
)
virtual

Implements CCSAXDelegator.

static CCTMXMapInfo*
formatWithTMXFile
( const char *  tmxFile)
static

creates a TMX Format with a tmx file

static CCTMXMapInfo* formatWithXML ( const char *  tmxString,
const char *  resourcePath 
)
static

creates a TMX Format with an XML string and a TMX resource path

const char* getCurrentString ( )
inline
virtual CCArray* getLayers ( void  )
virtual

getLayers

virtual const CCSize& getMapSize ( void  )
virtual

getMapSize

virtual CCArray* getObjectGroups ( void  )
virtual

getObjectGroups

virtual CCDictionary* getProperties ( void  )
virtual

getProperties

CCDictionary* getTileProperties ( )
virtual CCArray* getTilesets ( void  )
virtual

getTilesets

virtual const CCSize& getTileSize ( void  )
virtual

getTileSize

const char* getTMXFileName ( )
inline
bool initWithTMXFile ( const char *  tmxFile)

initializes a TMX format with a tmx file

bool initWithXML ( const char *  tmxString,
const char *  resourcePath 
)

initializes a TMX format with an XML string and a TMX resource path

bool parseXMLFile ( const char *  xmlFilename)

initializes parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file

bool parseXMLString ( const char *  xmlString)
void setCurrentString ( const char *  currentString)
inline
virtual void setLayers ( CCArray *  var)
virtual

setLayers

virtual void setMapSize ( const CCSize &  var)
virtual

set# MapSize

virtual void setObjectGroups ( CCArray *  var)
virtual

setObjectGroups

virtual void setProperties ( CCDictionary *  var)
virtual

setProperties

void setTileProperties ( CCDictionary *  tileProperties)
virtual void setTilesets ( CCArray *  var)
virtual

setTilesets

virtual void setTileSize ( const CCSize &  var)
virtual

set# TileSize

void setTMXFileName ( const char *  fileName)
inline
void startElement ( void *  ctx,
const char *  name,
const char **  atts 
)
virtual

implement pure virtual methods of CCSAXDelegator

Implements CCSAXDelegator.

void textHandler ( void *  ctx,
const char *  ch,
int  len 
)
virtual

Implements CCSAXDelegator.

Member Data Documentation

virtual int getLayerAttribs(void)\n\n
public

getLayerAttribs

setLayerAttribs

virtual int getOrientation(void)\n\n
public

getOrientation

setOrientation

virtual int getParentElement(void)\n\n
public

getParentElement

setParentElement

virtual unsigned int
getParentGID(void)\n\n public

getParentGID

setParentGID

virtual bool
getStoringCharacters(void)\n\n
public

getStoringCharacters

setStoringCharacters

bool m_bStoringCharacters
protected

is storing characters?

int m_nLayerAttribs
protected

layer attribs

int m_nOrientation
protected

map orientation

int m_nParentElement
protected

parent element

CCArray* m_pLayers
protected

Layers.

CCArray* m_pObjectGroups
protected

ObjectGroups.

CCDictionary* m_pProperties
protected

properties

CCDictionary* m_pTileProperties
protected

tile properties

CCArray* m_pTilesets
protected

tilesets

std::string m_sCurrentString
protected

current string

std::string m_sResources
protected
std::string m_sTMXFileName
protected

tmx filename

CCSize m_tMapSize
protected

map width & height

CCSize m_tTileSize
protected

tiles width & height

unsigned int m_uCurrentFirstGID
protected
unsigned int m_uParentGID
protected

parent GID


The documentation for this class was generated from the following file: