cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
CCTMXMapInfo Class Reference

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

#include <CCTMXXMLParser.h>

Inheritance diagram for CCTMXMapInfo:
[legend]
Collaboration diagram for CCTMXMapInfo:
[legend]

Public Member Functions

virtual int getOrientation (void)
 
virtual void setOrientation (int var)
 
virtual const CCSizegetMapSize (void)
 
virtual void setMapSize (const CCSize &var)
 
virtual const CCSizegetTileSize (void)
 
virtual void setTileSize (const CCSize &var)
 
virtual CCArraygetLayers (void)
 
virtual void setLayers (CCArray *var)
 
virtual CCArraygetTilesets (void)
 
virtual void setTilesets (CCArray *var)
 
virtual CCArraygetObjectGroups (void)
 
virtual void setObjectGroups (CCArray *var)
 
virtual int getParentElement (void)
 
virtual void setParentElement (int var)
 
virtual unsigned int getParentGID (void)
 
virtual void setParentGID (unsigned int var)
 
virtual int getLayerAttribs (void)
 
virtual void setLayerAttribs (int var)
 
virtual bool getStoringCharacters (void)
 
virtual void setStoringCharacters (bool var)
 
virtual CCDictionarygetProperties (void)
 
virtual void setProperties (CCDictionary *var)
 
 CCTMXMapInfo ()
 ctor NA More...
 
virtual ~CCTMXMapInfo ()
 NA NA. More...
 
bool initWithTMXFile (const char *tmxFile)
 initializes a TMX format with a tmx file NA More...
 
bool initWithXML (const char *tmxString, const char *resourcePath)
 initializes a TMX format with an XML string and a TMX resource path NA 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)
 
CCDictionarygetTileProperties ()
 
void setTileProperties (CCDictionary *tileProperties)
 
void startElement (void *ctx, const char *name, const char **atts)
 implement pure virtual methods of CCSAXDelegator NA More...
 
void endElement (void *ctx, const char *name)
 NA. More...
 
void textHandler (void *ctx, const char *ch, int len)
 NA. More...
 
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)
 NA. More...
 
void release (void)
 
void retain (void)
 
CCObjectautorelease (void)
 
CCObjectcopy (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)
 
 CCObject (const CCObject &)
 
CCObjectoperator= (const CCObject &)
 
virtual void encodeWithCoder (DS_Dictionary *)
 
virtual bool canEncode ()
 
CCObjectType getObjType () const
 
virtual int getTag () const
 
virtual void setTag (int nTag)
 
void setObjType (CCObjectType)
 
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)
 
virtual void startElement (void *ctx, const char *name, const char **atts)=0
 
virtual void endElement (void *ctx, const char *name)=0
 
virtual void textHandler (void *ctx, const char *s, int len)=0
 

Static Public Member Functions

static CCTMXMapInfoformatWithTMXFile (const char *tmxFile)
 creates a TMX Format with a tmx file More...
 
static CCTMXMapInfoformatWithXML (const char *tmxString, const char *resourcePath)
 creates a TMX Format with an XML string and a TMX resource path More...
 
- Static Public Member Functions inherited from CCObject
static CCObjectcreateWithCoder (DS_Dictionary *)
 

Protected Attributes

int m_nOrientation
 map orientation More...
 
CCSize m_tMapSize
 map width & height More...
 
CCSize m_tTileSize
 tiles width & height More...
 
CCArraym_pLayers
 Layers. More...
 
CCArraym_pTilesets
 tilesets More...
 
CCArraym_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...
 
CCDictionarym_pProperties
 properties More...
 
std::string m_sTMXFileName
 tmx filename More...
 
std::string m_sResources
 
std::string m_sCurrentString
 current string More...
 
CCDictionarym_pTileProperties
 tile properties More...
 
unsigned int m_uCurrentFirstGID
 
- Protected Attributes inherited from CCObject
unsigned int m_uReference
 
unsigned int m_uAutoReleaseCount
 
int m_nTag
 
int m_eObjType
 
unsigned int m_uObjectIdxInArray
 

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
 
int m_nLuaID
 

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

◆ CCTMXMapInfo()

ctor NA

◆ ~CCTMXMapInfo()

virtual ~CCTMXMapInfo ( )
virtual

NA NA.

Member Function Documentation

◆ endElement()

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

NA.

Implements CCSAXDelegator.

◆ formatWithTMXFile()

static CCTMXMapInfo * formatWithTMXFile ( const char *  tmxFile)
static

creates a TMX Format with a tmx file

◆ formatWithXML()

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

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

◆ getCurrentString()

const char * getCurrentString ( )
inline

◆ getLayerAttribs()

virtual int getLayerAttribs ( void  )
virtual

◆ getLayers()

virtual CCArray * getLayers ( void  )
virtual

◆ getMapSize()

virtual const CCSize & getMapSize ( void  )
virtual

◆ getObjectGroups()

virtual CCArray * getObjectGroups ( void  )
virtual

◆ getOrientation()

virtual int getOrientation ( void  )
virtual

◆ getParentElement()

virtual int getParentElement ( void  )
virtual

◆ getParentGID()

virtual unsigned int getParentGID ( void  )
virtual

◆ getProperties()

virtual CCDictionary * getProperties ( void  )
virtual

◆ getStoringCharacters()

virtual bool getStoringCharacters ( void  )
virtual

◆ getTileProperties()

CCDictionary * getTileProperties ( )

◆ getTilesets()

virtual CCArray * getTilesets ( void  )
virtual

◆ getTileSize()

virtual const CCSize & getTileSize ( void  )
virtual

◆ getTMXFileName()

const char * getTMXFileName ( )
inline

◆ initWithTMXFile()

bool initWithTMXFile ( const char *  tmxFile)

initializes a TMX format with a tmx file NA

◆ initWithXML()

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

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

◆ parseXMLFile()

bool parseXMLFile ( const char *  xmlFilename)

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

◆ parseXMLString()

bool parseXMLString ( const char *  xmlString)

◆ setCurrentString()

void setCurrentString ( const char *  currentString)
inline

◆ setLayerAttribs()

virtual void setLayerAttribs ( int  var)
virtual

◆ setLayers()

virtual void setLayers ( CCArray var)
virtual

◆ setMapSize()

virtual void setMapSize ( const CCSize var)
virtual

◆ setObjectGroups()

virtual void setObjectGroups ( CCArray var)
virtual

◆ setOrientation()

virtual void setOrientation ( int  var)
virtual

◆ setParentElement()

virtual void setParentElement ( int  var)
virtual

◆ setParentGID()

virtual void setParentGID ( unsigned int  var)
virtual

◆ setProperties()

virtual void setProperties ( CCDictionary var)
virtual

◆ setStoringCharacters()

virtual void setStoringCharacters ( bool  var)
virtual

◆ setTileProperties()

void setTileProperties ( CCDictionary tileProperties)

◆ setTilesets()

virtual void setTilesets ( CCArray var)
virtual

◆ setTileSize()

virtual void setTileSize ( const CCSize var)
virtual

◆ setTMXFileName()

void setTMXFileName ( const char *  fileName)
inline

◆ startElement()

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

implement pure virtual methods of CCSAXDelegator NA

Implements CCSAXDelegator.

◆ textHandler()

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

NA.

Implements CCSAXDelegator.

Member Data Documentation

◆ m_bStoringCharacters

bool m_bStoringCharacters
protected

is storing characters?

◆ m_nLayerAttribs

int m_nLayerAttribs
protected

layer attribs

◆ m_nOrientation

int m_nOrientation
protected

map orientation

◆ m_nParentElement

int m_nParentElement
protected

parent element

◆ m_pLayers

CCArray* m_pLayers
protected

Layers.

◆ m_pObjectGroups

CCArray* m_pObjectGroups
protected

ObjectGroups.

◆ m_pProperties

CCDictionary* m_pProperties
protected

properties

◆ m_pTileProperties

CCDictionary* m_pTileProperties
protected

tile properties

◆ m_pTilesets

CCArray* m_pTilesets
protected

tilesets

◆ m_sCurrentString

std::string m_sCurrentString
protected

current string

◆ m_sResources

std::string m_sResources
protected

◆ m_sTMXFileName

std::string m_sTMXFileName
protected

tmx filename

◆ m_tMapSize

CCSize m_tMapSize
protected

map width & height

◆ m_tTileSize

CCSize m_tTileSize
protected

tiles width & height

◆ m_uCurrentFirstGID

unsigned int m_uCurrentFirstGID
protected

◆ m_uParentGID

unsigned int m_uParentGID
protected

parent GID


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