TileMapAtlas Class Reference

#import <TileMapAtlas.h>

Inherits AtlasNode.

Collaboration diagram for TileMapAtlas:

Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithTileFile:mapFile:tileWidth:tileHeight:
(ccRGBB- tileAt:
(void) - setTile:at:
(void) - releaseMap

Static Public Member Functions

(id) + tileMapAtlasWithTileFile:mapFile:tileWidth:tileHeight:

Protected Attributes

NSMutableDictionary * posToAtlasIndex
 x,y to altas dicctionary
int itemsToRender
 numbers of tiles to render

Properties

CGSize contentSize
 size of the map in pixels
tImageTGAtgaInfo
 info about the map file


Detailed Description

TileMapAtlas is a subclass of AtlasNode.

It knows how to render a map based of tiles. The tiles must be in a .PNG format while the map must be a .TGA file.

For more information regarding the format, please see this post: http://blog.sapusmedia.com/2008/12/how-to-use-tilemap-editor-for-cocos2d.html

All features from AtlasNode are valid in TileMapAtlas


Member Function Documentation

- (id) initWithTileFile: (NSString *)  tile
mapFile: (NSString *)  map
tileWidth: (int)  w
tileHeight: (int)  h 

initializes the TileMap with a tile file (atlas) with a map file and the width and height of each tile

- (void) releaseMap  

dealloc the map from memory

- (void) setTile: (ccRGBB tile
at: (ccGridSize position 

sets a tile at position x,y. For the moment only channel R is used

- (ccRGBB) tileAt: (ccGridSize position  

returns a tile from position x,y. For the moment only channel R is used

+ (id) tileMapAtlasWithTileFile: (NSString *)  tile
mapFile: (NSString *)  map
tileWidth: (int)  w
tileHeight: (int)  h 

creates the TileMap with a tile file (atlas) with a map file and the width and height of each tile


Member Data Documentation

- (int) itemsToRender [protected]

numbers of tiles to render

- (NSMutableDictionary*) posToAtlasIndex [protected]

x,y to altas dicctionary


Property Documentation

- (CGSize) contentSize [read, assign]

size of the map in pixels

content size of the TileMap

- (tImageTGA *) tgaInfo [read, assign]

info about the map file

TileMap info


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

Generated on Tue Jun 9 10:39:46 2009 for cocos2d for iPhone 0.7.3 by  doxygen 1.5.8