cocos2d-x  3.3
 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...
 
var initWithTMXFile ( var 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...
 
var initWithXML ( var tmxString, var 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)
var setTileProperties ( var 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)
var setMapSize ( var 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)
var setLayers ( var 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)
var setTilesets ( var 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)
var setObjectGroups ( var 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...
 
var isStoringCharacters ()
 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...
 
var getProperties ()
 properties More...
 
local getProperties ()
 properties More...
 
ValueMapgetProperties ()
void setProperties (const ValueMap &properties)
var setProperties ( var 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
var getCurrentString ()
local getCurrentString ()
void setCurrentString (const std::string &currentString)
var setCurrentString ( var 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...
 
var createWithXML ( var tmxString, var 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...
 
var formatWithTMXFile ( var 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...
 

Protected Attributes

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

var ctor ( )
local TMXMapInfo ( )
virtual ~TMXMapInfo ( )
virtual

Member Function Documentation

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

creates a TMX Format with a tmx file

var create ( var  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

var createWithXML ( var  tmxString,
var  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

var formatWithTMXFile ( var  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

var formatWithXML ( var  tmxString,
var  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
var getCurrentString ( )
inline
local getCurrentString ( )
inline
int getLayerAttribs ( ) const
inline

layer attribs

var getLayerAttribs ( )
inline

layer attribs

local getLayerAttribs ( )
inline

layer attribs

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

Layers.

var getLayers ( )
inline

Layers.

local getLayers ( )
inline

Layers.

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

map width & height

var getMapSize ( )
inline

map width & height

local getMapSize ( )
inline

map width & height

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

ObjectGroups.

var getObjectGroups ( )
inline

ObjectGroups.

local getObjectGroups ( )
inline

ObjectGroups.

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

map orientation

var getOrientation ( )
inline

map orientation

local getOrientation ( )
inline

map orientation

int getParentElement ( ) const
inline

parent element

var getParentElement ( )
inline

parent element

local getParentElement ( )
inline

parent element

int getParentGID ( ) const
inline

parent GID

var getParentGID ( )
inline

parent GID

local getParentGID ( )
inline

parent GID

const ValueMap& getProperties ( ) const
inline

properties

var getProperties ( )
inline

properties

local getProperties ( )
inline

properties

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

tilesets

var getTilesets ( )
inline

tilesets

local getTilesets ( )
inline

tilesets

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

tiles width & height

var getTileSize ( )
inline

tiles width & height

local getTileSize ( )
inline

tiles width & height

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

initializes a TMX format with a tmx file

var initWithTMXFile ( var  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

var initWithXML ( var  tmxString,
var  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
var internalInit ( var  tmxFileName,
var  resourcePath 
)
protected
local internalInit ( local  tmxFileName,
local  resourcePath 
)
protected
bool isStoringCharacters ( ) const
inline

is storing characters?

var isStoringCharacters ( )
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

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

current string

var _currentString
protected

current string

local _currentString
protected

current string

int _layerAttribs
protected

layer attribs

var _layerAttribs
protected

layer attribs

local _layerAttribs
protected

layer attribs

Vector<TMXLayerInfo*> _layers
protected

Layers.

var _layers
protected

Layers.

local _layers
protected

Layers.

Size _mapSize
protected

map width & height

var _mapSize
protected

map width & height

local _mapSize
protected

map width & height

Vector<TMXObjectGroup*>
_objectGroups
protected

ObjectGroups.

var _objectGroups
protected

ObjectGroups.

local _objectGroups
protected

ObjectGroups.

int _orientation
protected

map orientation

var _orientation
protected

map orientation

local _orientation
protected

map orientation

int _parentElement
protected

parent element

var _parentElement
protected

parent element

local _parentElement
protected

parent element

int _parentGID
protected

parent GID

var _parentGID
protected

parent GID

local _parentGID
protected

parent GID

ValueMap _properties
protected

properties

var _properties
protected

properties

local _properties
protected

properties

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

is storing characters?

var _storingCharacters
protected

is storing characters?

local _storingCharacters
protected

is storing characters?

ValueMapIntKey _tileProperties
protected

tile properties

var _tileProperties
protected

tile properties

local _tileProperties
protected

tile properties

Vector<TMXTilesetInfo*> _tilesets
protected

tilesets

var _tilesets
protected

tilesets

local _tilesets
protected

tilesets

Size _tileSize
protected

tiles width & height

var _tileSize
protected

tiles width & height

local _tileSize
protected

tiles width & height

std::string _TMXFileName
protected

tmx filename

var _TMXFileName
protected

tmx filename

local _TMXFileName
protected

tmx filename

int _xmlTileIndex
protected

xml format tile index

var _xmlTileIndex
protected

xml format tile index

local _xmlTileIndex
protected

xml format tile index


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