cocos2d for iPhone 1.0.0
2D engine for iOS and OS X
Public Member Functions | Static Public Member Functions | Properties
CCTMXTiledMap Class Reference

#import <CCTMXTiledMap.h>

Inheritance diagram for CCTMXTiledMap:
Inheritance graph
[legend]
Collaboration diagram for CCTMXTiledMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithTMXFile:
(CCTMXLayer *) - layerNamed:
(CCTMXObjectGroup *) - objectGroupNamed:
(CCTMXObjectGroup *) - groupNamed:
(id) - propertyNamed:
(NSDictionary *) - propertiesForGID:

Static Public Member Functions

(id) + tiledMapWithTMXFile:

Properties

CGSize mapSize
CGSize tileSize
int mapOrientation
NSMutableArray * objectGroups
NSMutableDictionary * properties

Detailed Description

CCTMXTiledMap knows how to parse and render a TMX map.

It adds support for the TMX tiled map format used by http://www.mapeditor.org It supports isometric, hexagonal and orthogonal tiles. It also supports object groups, objects, and properties.

Features:

Limitations:

Technical description: Each layer is created using an CCTMXLayer (subclass of CCSpriteBatchNode). If you have 5 layers, then 5 CCTMXLayer will be created, unless the layer visibility is off. In that case, the layer won't be created at all. You can obtain the layers (CCTMXLayer objects) at runtime by:

Each object group is created using a CCTMXObjectGroup which is a subclass of NSMutableArray. You can obtain the object groups at runtime by:

Each object is a CCTMXObject.

Each property is stored as a key-value pair in an NSMutableDictionary. You can obtain the properties at runtime by:

[map propertyNamed: name_of_the_property]; [layer propertyNamed: name_of_the_property]; [objectGroup propertyNamed: name_of_the_property]; [object propertyNamed: name_of_the_property];

Since:
v0.8.1

Definition at line 101 of file CCTMXTiledMap.h.


Member Function Documentation

- (CCTMXObjectGroup*) groupNamed: (NSString *)  DEPRECATED_ATTRIBUTE

return the TMXObjectGroup for the secific group

Deprecated:
Use map::objectGroupNamed instead
- (id) initWithTMXFile: (NSString *)  tmxFile

initializes a TMX Tiled Map with a TMX file

- (CCTMXLayer*) layerNamed: (NSString *)  layerName

return the TMXLayer for the specific layer

- (CCTMXObjectGroup*) objectGroupNamed: (NSString *)  groupName

return the TMXObjectGroup for the secific group

- (NSDictionary*) propertiesForGID: (unsigned int)  GID

return properties dictionary for tile GID

- (id) propertyNamed: (NSString *)  propertyName

return the value for the specific property name

+ (id) tiledMapWithTMXFile: (NSString *)  tmxFile

creates a TMX Tiled Map with a TMX file.


Property Documentation

- (int) mapOrientation [read, assign]

map orientation

Definition at line 116 of file CCTMXTiledMap.h.

- (CGSize) mapSize [read, assign]

the map's size property measured in tiles

Definition at line 112 of file CCTMXTiledMap.h.

- (NSMutableArray*) objectGroups [read, write, retain]

object groups

Definition at line 118 of file CCTMXTiledMap.h.

- (NSMutableDictionary*) properties [read, write, retain]

properties

Definition at line 120 of file CCTMXTiledMap.h.

- (CGSize) tileSize [read, assign]

the tiles's size property measured in pixels

Definition at line 114 of file CCTMXTiledMap.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

cocos2d for iPhone API Reference - Generated using Doxygen 1.7.4