Class cc.AtlasNode
Extends
cc.Node.
Defined in: CCAtlasNode.js.
Constructor Attributes | Constructor Name and Description |
---|---|
cc.AtlasNode is a subclass of cc.Node that implements the cc.RGBAProtocol and It knows how to render a TextureAtlas object. |
Method Attributes | Method Name and Description |
---|---|
<static> |
cc.AtlasNode.create(tile, tileWidth, tileHeight, itemsToRender)
creates a cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
|
draw(ctx)
|
|
cc.AtlasNode - CocosNodeTexture protocol
|
|
getColor()
cc.AtlasNode - RGBA protocol
|
|
returns the used texture
|
|
initWithTileFile(tile, tileWidth, tileHeight, itemsToRender)
initializes an cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
|
|
setBlendFunc(blendFunc, dst)
|
|
setColor(color3)
|
|
setOpacity(opacity)
|
|
setOpacityModifyRGB(value)
|
|
setQuadsToDraw(quadsToDraw)
|
|
setTexture(texture)
sets a new texture.
|
|
setTextureAtlas(value)
|
|
updates the Atlas (indexed vertex array).
|
- 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.AtlasNode()
cc.AtlasNode is a subclass of cc.Node that implements the cc.RGBAProtocol and
cc.TextureProtocol protocol
It knows how to render a TextureAtlas object.
If you are going to render a TextureAtlas consider subclassing cc.AtlasNode (or a subclass of cc.AtlasNode)
All features from cc.Node are valid, plus the following features:
- opacity and RGB colors
Method Detail
<static>
{cc.AtlasNode}
cc.AtlasNode.create(tile, tileWidth, tileHeight, itemsToRender)
creates a cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
// example var node = cc.AtlasNode.create("pathOfTile", 16, 16, 1);
- Parameters:
- {String} tile
- {Number} tileWidth
- {Number} tileHeight
- {Number} itemsToRender
- Returns:
- {cc.AtlasNode}
draw(ctx)
- Parameters:
- {CanvasContext} ctx
- CanvasContext
{cc.BlendFunc}
getBlendFunc()
cc.AtlasNode - CocosNodeTexture protocol
- Returns:
- {cc.BlendFunc}
{cc.Color3B}
getColor()
cc.AtlasNode - RGBA protocol
- Returns:
- {cc.Color3B}
{Number}
getOpacity()
- Returns:
- {Number}
{Number}
getQuadsToDraw()
- Returns:
- {Number}
{cc.Texture2D}
getTexture()
returns the used texture
- Returns:
- {cc.Texture2D}
{cc.TextureAtlas}
getTextureAtlas()
- Returns:
- {cc.TextureAtlas}
{Boolean}
initWithTileFile(tile, tileWidth, tileHeight, itemsToRender)
initializes an cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
- Parameters:
- {String} tile
- {Number} tileWidth
- {Number} tileHeight
- {Number} itemsToRender
- Returns:
- {Boolean}
{Boolean}
isOpacityModifyRGB()
- Returns:
- {Boolean}
setBlendFunc(blendFunc, dst)
- Parameters:
- {cc.BlendFunc} blendFunc
- dst
setColor(color3)
- Parameters:
- {cc.Color3B} color3
setOpacity(opacity)
- Parameters:
- {Number} opacity
setOpacityModifyRGB(value)
- Parameters:
- {Boolean} value
setQuadsToDraw(quadsToDraw)
- Parameters:
- {Number} quadsToDraw
setTexture(texture)
sets a new texture. it will be retained
- Parameters:
- {cc.Texture2D} texture
setTextureAtlas(value)
- Parameters:
- {cc.TextureAtlas} value
updateAtlasValues()
updates the Atlas (indexed vertex array).
Shall be overriden in subclasses