cocos2d-x  3.2rc0
 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:
Ref SAXDelegator

Public Member Functions

 TMXMapInfo ()
virtual ~TMXMapInfo ()
bool initWithTMXFile (const std::string &tmxFile)
 initializes a TMX format with a tmx file More...
 
local initWithTMXFile ( local tmxFile)
 initializes a TMX format with a tmx file More...
 
bool initWithXML (const std::string &tmxString, const std::string &resourcePath)
 initializes a TMX format with an XML string and a TMX resource path More...
 
local initWithXML ( local tmxString, local resourcePath)
 initializes a TMX format with an XML string and a TMX resource path More...
 
bool parseXMLFile (const std::string &xmlFilename)
 initializes parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file More...
 
bool parseXMLString (const std::string &xmlString)
ValueMapIntKeygetTileProperties ()
void setTileProperties (const ValueMapIntKey &tileProperties)
local setTileProperties ( local tileProperties)
int getOrientation () const
 map orientation More...
 
local getOrientation ()
 map orientation More...
 
void setOrientation (int orientation)
local setOrientation ( local orientation)
const SizegetMapSize () const
 map width & height More...
 
local getMapSize ()
 map width & height More...
 
void setMapSize (const Size &mapSize)
local setMapSize ( local mapSize)
const SizegetTileSize () const
 tiles width & height More...
 
local getTileSize ()
 tiles width & height More...
 
void setTileSize (const Size &tileSize)
const Vector< TMXLayerInfo * > & getLayers () const
 Layers. More...
 
local getLayers ()
 Layers. More...
 
Vector< TMXLayerInfo * > & getLayers ()
local getLayers ()
void setLayers (const Vector< TMXLayerInfo * > &layers)
local setLayers ( local layers)
const Vector< TMXTilesetInfo * > & getTilesets () const
 tilesets More...
 
local getTilesets ()
 tilesets More...
 
Vector< TMXTilesetInfo * > & getTilesets ()
local getTilesets ()
void setTilesets (const Vector< TMXTilesetInfo * > &tilesets)
local setTilesets ( local tilesets)
const Vector< TMXObjectGroup * > & getObjectGroups () const
 ObjectGroups. More...
 
local getObjectGroups ()
 ObjectGroups. More...
 
Vector< TMXObjectGroup * > & getObjectGroups ()
void setObjectGroups (const Vector< TMXObjectGroup * > &groups)
local setObjectGroups ( local groups)
int getParentElement () const
 parent element More...
 
local getParentElement ()
 parent element More...
 
void setParentElement (int element)
local setParentElement ( local element)
int getParentGID () const
 parent GID More...
 
local getParentGID ()
 parent GID More...
 
void setParentGID (int gid)
local setParentGID ( local gid)
int getLayerAttribs () const
 layer attribs More...
 
local getLayerAttribs ()
 layer attribs More...
 
void setLayerAttribs (int layerAttribs)
local setLayerAttribs ( local layerAttribs)
bool isStoringCharacters () const
 is storing characters? More...
 
local isStoringCharacters ()
 is storing characters? More...
 
bool getStoringCharacters () const
local getStoringCharacters ()
void setStoringCharacters (bool storingCharacters)
local setStoringCharacters ( local storingCharacters)
const ValueMapgetProperties () const
 properties More...
 
local getProperties ()
 properties More...
 
ValueMapgetProperties ()
void setProperties (const ValueMap &properties)
local setProperties ( local 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 std::string & getCurrentString () const
local getCurrentString ()
void setCurrentString (const std::string &currentString)
local setCurrentString ( local currentString)
const std::string & getTMXFileName () const
local getTMXFileName ()
void setTMXFileName (const std::string &fileName)
local setTMXFileName ( local fileName)
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
- Public Member Functions inherited from SAXDelegator
virtual ~SAXDelegator ()
var ~SAXDelegator ()
local ~SAXDelegator ()

Static Public Member Functions

static TMXMapInfocreate (const std::string &tmxFile)
 creates a TMX Format with a tmx file More...
 
static TMXMapInfocreateWithXML (const std::string &tmxString, const std::string &resourcePath)
 creates a TMX Format with an XML string and a TMX resource path More...
 
local createWithXML ( local tmxString, local resourcePath)
 creates a TMX Format with an XML string and a TMX resource path More...
 
static TMXMapInfoformatWithTMXFile (const char *tmxFile)
 creates a TMX Format with a tmx file More...
 
local formatWithTMXFile ( local tmxFile)
 creates a TMX Format with a tmx file More...
 
static TMXMapInfoformatWithXML (const char *tmxString, const char *resourcePath)
 creates a TMX Format with an XML string and a TMX resource path More...
 

Protected Member Functions

void internalInit (const std::string &tmxFileName, const std::string &resourcePath)
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

int _orientation
 map orientation More...
 
Size _mapSize
 map width & height More...
 
local _mapSize
 map width & height More...
 
Size _tileSize
 tiles width & height More...
 
local _tileSize
 tiles width & height More...
 
Vector< TMXLayerInfo * > _layers
 Layers. More...
 
local _layers
 Layers. More...
 
Vector< TMXTilesetInfo * > _tilesets
 tilesets More...
 
local _tilesets
 tilesets More...
 
Vector< TMXObjectGroup * > _objectGroups
 ObjectGroups. More...
 
local _objectGroups
 ObjectGroups. More...
 
int _parentElement
 parent element More...
 
local _parentElement
 parent element More...
 
int _parentGID
 parent GID More...
 
local _parentGID
 parent GID More...
 
int _layerAttribs
 layer attribs More...
 
local _layerAttribs
 layer attribs More...
 
bool _storingCharacters
 is storing characters? More...
 
local _storingCharacters
 is storing characters? More...
 
ValueMap _properties
 properties More...
 
local _properties
 properties More...
 
int _xmlTileIndex
 xml format tile index More...
 
local _xmlTileIndex
 xml format tile index More...
 
std::string _TMXFileName
 tmx filename More...
 
local _TMXFileName
 tmx filename More...
 
std::string _resources
local _resources
std::string _currentString
 current string More...
 
local _currentString
 current string More...
 
ValueMapIntKey _tileProperties
 tile properties More...
 
local _tileProperties
 tile properties More...
 
int _currentFirstGID
local _currentFirstGID
bool _recordFirstGID
local _recordFirstGID
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
var _referenceCount
 count of references More...
 
local _referenceCount
 count of references 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

local TMXMapInfo ( )
virtual ~TMXMapInfo ( )
virtual

Member Function Documentation

static TMXMapInfo* create ( const std::string &  tmxFile)
static

creates a TMX Format with a tmx file

local create ( local  tmxFile)
static

creates a TMX Format with a tmx file

static TMXMapInfo* createWithXML ( const std::string &  tmxString,
const std::string &  resourcePath 
)
static

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

local createWithXML ( local  tmxString,
local  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 TMXMapInfo*
formatWithTMXFile
( const char *  tmxFile)
inlinestatic

creates a TMX Format with a tmx file

local formatWithTMXFile ( local  tmxFile)
inlinestatic

creates a TMX Format with a tmx file

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

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

local formatWithXML ( local  tmxString,
local  resourcePath 
)
inlinestatic

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

const std::string& getCurrentString ( ) const
inline
local getCurrentString ( )
inline
int getLayerAttribs ( ) const
inline

layer attribs

local getLayerAttribs ( )
inline

layer attribs

const Vector<TMXLayerInfo*>
& getLayers
( ) const
inline

Layers.

local getLayers ( )
inline

Layers.

Vector<TMXLayerInfo*>& getLayers ( )
inline
local getLayers ( )
inline
const Size& getMapSize ( ) const
inline

map width & height

local getMapSize ( )
inline

map width & height

const Vector<TMXObjectGroup*>
& getObjectGroups
( ) const
inline

ObjectGroups.

local getObjectGroups ( )
inline

ObjectGroups.

Vector<TMXObjectGroup*>
& getObjectGroups
( )
inline
local getObjectGroups ( )
inline
int getOrientation ( ) const
inline

map orientation

local getOrientation ( )
inline

map orientation

int getParentElement ( ) const
inline

parent element

local getParentElement ( )
inline

parent element

int getParentGID ( ) const
inline

parent GID

local getParentGID ( )
inline

parent GID

const ValueMap& getProperties ( ) const
inline

properties

local getProperties ( )
inline

properties

ValueMap& getProperties ( )
inline
local getProperties ( )
inline
bool getStoringCharacters ( ) const
inline
local getStoringCharacters ( )
inline
ValueMapIntKey& getTileProperties ( )
inline
local getTileProperties ( )
inline
const Vector<TMXTilesetInfo*>
& getTilesets
( ) const
inline

tilesets

local getTilesets ( )
inline

tilesets

Vector<TMXTilesetInfo*>
& getTilesets
( )
inline
local getTilesets ( )
inline
const Size& getTileSize ( ) const
inline

tiles width & height

local getTileSize ( )
inline

tiles width & height

const std::string& getTMXFileName ( ) const
inline
local getTMXFileName ( )
inline
bool initWithTMXFile ( const std::string &  tmxFile)

initializes a TMX format with a tmx file

local initWithTMXFile ( local  tmxFile)

initializes a TMX format with a tmx file

bool initWithXML ( const std::string &  tmxString,
const std::string &  resourcePath 
)

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

local initWithXML ( local  tmxString,
local  resourcePath 
)

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

void internalInit ( const std::string &  tmxFileName,
const std::string &  resourcePath 
)
protected
local internalInit ( local  tmxFileName,
local  resourcePath 
)
protected
bool isStoringCharacters ( ) const
inline

is storing characters?

local isStoringCharacters ( )
inline

is storing characters?

bool parseXMLFile ( const std::string &  xmlFilename)

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

local parseXMLFile ( local  xmlFilename)

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

bool parseXMLString ( const std::string &  xmlString)
local parseXMLString ( local  xmlString)
void setCurrentString ( const std::string &  currentString)
inline
local setCurrentString ( local  currentString)
inline
void setLayerAttribs ( int  layerAttribs)
inline
local setLayerAttribs ( local  layerAttribs)
inline
void setLayers ( const Vector< TMXLayerInfo * > &  layers)
inline
local setLayers ( local  layers)
inline
void setMapSize ( const Size mapSize)
inline
local setMapSize ( local  mapSize)
inline
void setObjectGroups ( const Vector< TMXObjectGroup * > &  groups)
inline
local setObjectGroups ( local  groups)
inline
void setOrientation ( int  orientation)
inline
local setOrientation ( local  orientation)
inline
void setParentElement ( int  element)
inline
local setParentElement ( local  element)
inline
void setParentGID ( int  gid)
inline
local setParentGID ( local  gid)
inline
void setProperties ( const ValueMap properties)
inline
local setProperties ( local  properties)
inline
void setStoringCharacters ( bool  storingCharacters)
inline
local setStoringCharacters ( local  storingCharacters)
inline
void setTileProperties ( const ValueMapIntKey tileProperties)
inline
local setTileProperties ( local  tileProperties)
inline
void setTilesets ( const Vector< TMXTilesetInfo * > &  tilesets)
inline
local setTilesets ( local  tilesets)
inline
void setTileSize ( const Size tileSize)
inline
local setTileSize ( local  tileSize)
inline
void setTMXFileName ( const std::string &  fileName)
inline
local setTMXFileName ( local  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

int _currentFirstGID
protected
local _currentFirstGID
protected
std::string _currentString
protected

current string

local _currentString
protected

current string

int _layerAttribs
protected

layer attribs

local _layerAttribs
protected

layer attribs

Vector<TMXLayerInfo*> _layers
protected

Layers.

local _layers
protected

Layers.

Size _mapSize
protected

map width & height

local _mapSize
protected

map width & height

Vector<TMXObjectGroup*>
_objectGroups
protected

ObjectGroups.

local _objectGroups
protected

ObjectGroups.

int _orientation
protected

map orientation

local _orientation
protected

map orientation

int _parentElement
protected

parent element

local _parentElement
protected

parent element

int _parentGID
protected

parent GID

local _parentGID
protected

parent GID

ValueMap _properties
protected

properties

local _properties
protected

properties

bool _recordFirstGID
protected
local _recordFirstGID
protected
std::string _resources
protected
local _resources
protected
bool _storingCharacters
protected

is storing characters?

local _storingCharacters
protected

is storing characters?

ValueMapIntKey _tileProperties
protected

tile properties

local _tileProperties
protected

tile properties

Vector<TMXTilesetInfo*> _tilesets
protected

tilesets

local _tilesets
protected

tilesets

Size _tileSize
protected

tiles width & height

local _tileSize
protected

tiles width & height

std::string _TMXFileName
protected

tmx filename

local _TMXFileName
protected

tmx filename

int _xmlTileIndex
protected

xml format tile index

local _xmlTileIndex
protected

xml format tile index


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