Class Index | File Index

Classes


Class cc.TileMapAtlas


Extends cc.AtlasNode.

Defined in: CCTileMapAtlas.js.

Class Summary
Constructor Attributes Constructor Name and Description
 

cc.TileMapAtlas is a subclass of cc.AtlasNode.

Method Summary
Method Attributes Method Name and Description
<static>  
cc.TileMapAtlas.create(tile, mapFile, tileWidth, tileHeight)

Creates a cc.TileMap with a tile file (atlas) with a map file and the width and height of each tile in points.

 
 
initWithTileFile(tile, mapFile, tileWidth, tileHeight)
Initializes a cc.TileMap with a tile file (atlas) with a map file and the width and height of each tile in points.
 
Dealloc the map from memory
 
 
setTile(tile, position)
Sets a tile at position x,y.
 
tileAt(position)

Returns a tile from position x,y.

Methods borrowed from class cc.AtlasNode:
draw, getBlendFunc, getColor, getOpacity, getQuadsToDraw, getTexture, getTextureAtlas, isOpacityModifyRGB, setBlendFunc, setColor, setOpacity, setOpacityModifyRGB, setQuadsToDraw, setTexture, setTextureAtlas, updateAtlasValues
Methods borrowed from class cc.Node:
addChild, cleanup, convertToNodeSpace, convertToNodeSpaceAR, convertTouchToNodeSpace, convertTouchToNodeSpaceAR, convertToWorldSpace, convertToWorldSpaceAR, ctor, description, getActionByTag, getActionManager, getAnchorPoint, getAnchorPointInPoints, getBoundingBox, getBoundingBoxToWorld, getCamera, getChildByTag, getChildren, getChildrenCount, getContentSize, getGLServerState, getGrid, getOrderOfArrival, getParent, getPosition, getPositionX, getPositionY, getRotation, getScale, getScaleX, getScaleY, getScheduler, getShaderProgram, getSkewX, getSkewY, getTag, getUserData, getUserObject, getVertexZ, getZOrder, ignoreAnchorPointForPosition, init, isIgnoreAnchorPointForPosition, isRunning, isVisible, nodeToParentTransform, nodeToWorldTransform, numberOfRunningActions, onEnter, onEnterTransitionDidFinish, onExit, onExitTransitionDidStart, parentToNodeTransform, pauseSchedulerAndActions, release, removeAllChildren, removeAllChildrenWithCleanup, removeChild, removeChildByTag, removeFromParent, removeFromParentAndCleanup, reorderChild, resumeSchedulerAndActions, retain, runAction, schedule, scheduleOnce, scheduleUpdate, scheduleUpdateWithPriority, setActionManager, setAnchorPoint, setContentSize, setGLServerState, setGrid, setNodeDirty, setOrderOfArrival, setParent, setPosition, setPositionX, setPositionY, setRotation, setScale, setScaleX, setScaleY, setScheduler, setShaderProgram, setSkewX, setSkewY, setTag, setUserData, setUserObject, setVertexZ, setVisible, setZOrder, sortAllChildren, stopAction, stopActionByTag, stopAllActions, transform, transformAncestors, unschedule, unscheduleAllCallbacks, unscheduleUpdate, update, updateTransform, visit, worldToNodeTransform
Class Detail
cc.TileMapAtlas()

cc.TileMapAtlas is a subclass of cc.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://www.cocos2d-iphone.org/archives/27

All features from cc.AtlasNode are valid in cc.TileMapAtlas

IMPORTANT:
This class is deprecated. It is maintained for compatibility reasons only.
You SHOULD not use this class.
Instead, use the newer TMX file format: cc.TMXTiledMap

Method Detail
<static> {Boolean|Null} cc.TileMapAtlas.create(tile, mapFile, tileWidth, tileHeight)

Creates a cc.TileMap with a tile file (atlas) with a map file and the width and height of each tile in points.
The tile file will be loaded using the TextureMgr.

//example
var tmpAtlas = new cc.TileMapAtlas();
 tmpAtlas.initWithTileFile("hello.png", "hello.tga", 16, 16);
Parameters:
{String} tile
{String} mapFile
{Number} tileWidth
{Number} tileHeight
Returns:
{Boolean|Null}

{cc.ImageTGA} getTGAInfo()
Returns:
{cc.ImageTGA}

{Boolean} initWithTileFile(tile, mapFile, tileWidth, tileHeight)
Initializes a cc.TileMap with a tile file (atlas) with a map file and the width and height of each tile in points.
The file will be loaded using the TextureMgr.
//example
var tmpAtlas = new cc.TileMapAtlas();
tmpAtlas.initWithTileFile("hello.png", "hello.tga", 16, 16);
Parameters:
{String} tile
{String} mapFile
{Number} tileWidth
{Number} tileHeight
Returns:
{Boolean}

releaseMap()
Dealloc the map from memory

setTGAInfo(Var)
Parameters:
{cc.ImageTGA} Var

setTile(tile, position)
Sets a tile at position x,y. For the moment only channel R is used
Parameters:
{cc.Sprite} tile
{cc.Point} position

{cc.Sprite} tileAt(position)

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

Parameters:
{cc.Point} position
Returns:
{cc.Sprite}

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:54 GMT-0800 (PST)