cocos2d-x  3.0alpha1
 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 std::string &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...
 
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)
local parseXMLString ( local xmlString)
DictionarygetTileProperties ()
void setTileProperties (Dictionary *tileProperties)
int getOrientation () const
 map orientation More...
 
void setOrientation (int orientation)
const SizegetMapSize () const
 map width & height More...
 
var getMapSize ()
 map width & height More...
 
local getMapSize ()
 map width & height More...
 
void setMapSize (const Size &mapSize)
const SizegetTileSize () const
 tiles width & height More...
 
local getTileSize ()
 tiles width & height More...
 
void setTileSize (const Size &tileSize)
ArraygetLayers () const
 Layers. More...
 
void setLayers (Array *layers)
ArraygetTilesets () const
 tilesets More...
 
local getTilesets ()
 tilesets More...
 
void setTilesets (Array *tilesets)
ArraygetObjectGroups () const
 ObjectGroups. More...
 
void setObjectGroups (Array *groups)
int getParentElement () const
 parent element More...
 
var getParentElement ()
 parent element More...
 
local getParentElement ()
 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 std::string & getCurrentString () const
void setCurrentString (const std::string &currentString)
const std::string & getTMXFileName () const
void setTMXFileName (const std::string &fileName)
local setTMXFileName ( local 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)
- Public Member Functions inherited from SAXDelegator
virtual ~SAXDelegator ()

Static Public Member Functions

static TMXMapInfocreate (const std::string &tmxFile)
 creates a TMX Format with a tmx file More...
 
var create ( var tmxFile)
 creates a TMX Format with a tmx file More...
 
local create ( local 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...
 
static CC_DEPRECATED_ATTRIBUTE
TMXMapInfo
formatWithTMXFile (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 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 Member Functions

void internalInit (const std::string &tmxFileName, const std::string &resourcePath)

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...
 
Array_layers
 Layers. More...
 
var _layers
 Layers. More...
 
local _layers
 Layers. More...
 
Array_tilesets
 tilesets More...
 
var _tilesets
 tilesets More...
 
local _tilesets
 tilesets More...
 
Array_objectGroups
 ObjectGroups. More...
 
var _objectGroups
 ObjectGroups. More...
 
local _objectGroups
 ObjectGroups. More...
 
int _parentElement
 parent element More...
 
unsigned int _parentGID
 parent GID More...
 
var _parentGID
 parent GID More...
 
local _parentGID
 parent GID More...
 
int _layerAttribs
 layer attribs More...
 
var _layerAttribs
 layer attribs More...
 
local _layerAttribs
 layer attribs More...
 
bool _storingCharacters
 is storing characters? More...
 
local _storingCharacters
 is storing characters? More...
 
Dictionary_properties
 properties More...
 
std::string _TMXFileName
 tmx filename More...
 
std::string _resources
std::string _currentString
 current string More...
 
var _currentString
 current string More...
 
local _currentString
 current string More...
 
Dictionary_tileProperties
 tile properties More...
 
var _tileProperties
 tile properties More...
 
local _tileProperties
 tile properties More...
 
unsigned int _currentFirstGID
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
unsigned int _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

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 CC_DEPRECATED_ATTRIBUTE
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 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

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

Array* getLayers ( ) const
inline

Layers.

var getLayers ( )
inline

Layers.

local getLayers ( )
inline

Layers.

const Size& getMapSize ( ) const
inline

map width & height

var getMapSize ( )
inline

map width & height

local getMapSize ( )
inline

map width & height

Array* getObjectGroups ( ) const
inline

ObjectGroups.

var getObjectGroups ( )
inline

ObjectGroups.

local getObjectGroups ( )
inline

ObjectGroups.

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

unsigned int getParentGID ( ) const
inline

parent GID

var getParentGID ( )
inline

parent GID

local getParentGID ( )
inline

parent GID

Dictionary* getProperties ( ) const
inline

properties

var getProperties ( )
inline

properties

local getProperties ( )
inline

properties

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

tilesets

var getTilesets ( )
inline

tilesets

local getTilesets ( )
inline

tilesets

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 ( Array 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 ( Array 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 ( unsigned int  gid)
inline
var setParentGID ( var  gid)
inline
local setParentGID ( local  gid)
inline
void setProperties ( Dictionary 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 ( Dictionary tileProperties)
inline
var setTileProperties ( var  tileProperties)
inline
local setTileProperties ( local  tileProperties)
inline
void setTilesets ( Array 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

unsigned 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

Array* _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

Array* _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

unsigned int _parentGID
protected

parent GID

var _parentGID
protected

parent GID

local _parentGID
protected

parent GID

Dictionary* _properties
protected

properties

var _properties
protected

properties

local _properties
protected

properties

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?

Dictionary* _tileProperties
protected

tile properties

var _tileProperties
protected

tile properties

local _tileProperties
protected

tile properties

Array* _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


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