cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TMXMapInfo Class Reference

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

#include <CCTMXXMLParser.h>

Inheritance diagram for TMXMapInfo:
Object SAXDelegator

Public Member Functions

 TMXMapInfo ()
virtual ~TMXMapInfo ()
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)
DictionarygetTileProperties ()
void setTileProperties (Dictionary *tileProperties)
int getOrientation () const
 map orientation More...
 
void setOrientation (int orientation)
const SizegetMapSize () const
 map width & height More...
 
void setMapSize (const Size &mapSize)
const SizegetTileSize () const
 tiles width & height More...
 
void setTileSize (const Size &tileSize)
ArraygetLayers () const
 Layers. More...
 
void setLayers (Array *layers)
ArraygetTilesets () const
 tilesets More...
 
void setTilesets (Array *tilesets)
ArraygetObjectGroups () const
 ObjectGroups. More...
 
void setObjectGroups (Array *groups)
int getParentElement () const
 parent element More...
 
void setParentElement (int element)
unsigned int getParentGID () const
 parent GID More...
 
void setParentGID (unsigned int gid)
int getLayerAttribs () const
 layer attribs More...
 
void setLayerAttribs (int layerAttribs)
bool isStoringCharacters () const
 is storing characters? More...
 
CC_DEPRECATED_ATTRIBUTE bool getStoringCharacters () const
void setStoringCharacters (bool storingCharacters)
DictionarygetProperties () const
 properties More...
 
void setProperties (Dictionary *properties)
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)
const char * getCurrentString ()
void setCurrentString (const char *currentString)
const char * getTMXFileName ()
void setTMXFileName (const char *fileName)
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Static Public Member Functions

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

Protected Attributes

int _orientation
 map orientation More...
 
Size _mapSize
 map width & height More...
 
Size _tileSize
 tiles width & height More...
 
Array_layers
 Layers. More...
 
Array_tilesets
 tilesets More...
 
Array_objectGroups
 ObjectGroups. More...
 
int _parentElement
 parent element More...
 
unsigned int _parentGID
 parent GID More...
 
int _layerAttribs
 layer attribs More...
 
bool _storingCharacters
 is storing characters? More...
 
Dictionary_properties
 properties More...
 
std::string _TMXFileName
 tmx filename More...
 
std::string _resources
std::string _currentString
 current string More...
 
Dictionary_tileProperties
 tile properties More...
 
unsigned int _currentFirstGID
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 

Detailed Description

TMXMapInfo 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 ~TMXMapInfo ( )
virtual

Member Function Documentation

static TMXMapInfo* create ( const char *  tmxFile)
static

creates a TMX Format with a tmx file

static TMXMapInfo* createWithXML ( const char *  tmxString,
const char *  resourcePath 
)
static

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

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

Implements SAXDelegator.

static CC_DEPRECATED_ATTRIBUTE
TMXMapInfo* formatWithTMXFile
( const char *  tmxFile)
inlinestatic

creates a TMX Format with a tmx file

static CC_DEPRECATED_ATTRIBUTE
TMXMapInfo* formatWithXML
( const char *  tmxString,
const char *  resourcePath 
)
inlinestatic

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

const char* getCurrentString ( )
inline
int getLayerAttribs ( ) const
inline

layer attribs

Array* getLayers ( ) const
inline

Layers.

const Size& getMapSize ( ) const
inline

map width & height

Array* getObjectGroups ( ) const
inline

ObjectGroups.

int getOrientation ( ) const
inline

map orientation

int getParentElement ( ) const
inline

parent element

unsigned int getParentGID ( ) const
inline

parent GID

Dictionary* getProperties ( ) const
inline

properties

CC_DEPRECATED_ATTRIBUTE bool
getStoringCharacters
( ) const
inline
Dictionary* getTileProperties ( )
inline
Array* getTilesets ( ) const
inline

tilesets

const Size& getTileSize ( ) const
inline

tiles width & height

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 isStoringCharacters ( ) const
inline

is storing characters?

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
void setLayerAttribs ( int  layerAttribs)
inline
void setLayers ( Array layers)
inline
void setMapSize ( const Size mapSize)
inline
void setObjectGroups ( Array groups)
inline
void setOrientation ( int  orientation)
inline
void setParentElement ( int  element)
inline
void setParentGID ( unsigned int  gid)
inline
void setProperties ( Dictionary properties)
inline
void setStoringCharacters ( bool  storingCharacters)
inline
void setTileProperties ( Dictionary tileProperties)
inline
void setTilesets ( Array tilesets)
inline
void setTileSize ( const Size tileSize)
inline
void setTMXFileName ( const char *  fileName)
inline
void startElement ( void *  ctx,
const char *  name,
const char **  atts 
)
virtual

Implements SAXDelegator.

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

Implements SAXDelegator.

Member Data Documentation

unsigned int _currentFirstGID
protected
std::string _currentString
protected

current string

int _layerAttribs
protected

layer attribs

Array* _layers
protected

Layers.

Size _mapSize
protected

map width & height

Array* _objectGroups
protected

ObjectGroups.

int _orientation
protected

map orientation

int _parentElement
protected

parent element

unsigned int _parentGID
protected

parent GID

Dictionary* _properties
protected

properties

std::string _resources
protected
bool _storingCharacters
protected

is storing characters?

Dictionary* _tileProperties
protected

tile properties

Array* _tilesets
protected

tilesets

Size _tileSize
protected

tiles width & height

std::string _TMXFileName
protected

tmx filename


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