Class cc.AtlasNode
- Defined in: CCAtlasNode.js
- Extends cc.NodeRGBA
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 Summary
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
Field Detail
{cc.Texture2D}
getTexture
returns the used texture
{Boolean}
initWithTexture
initializes an CCAtlasNode with a texture the width and height of each item measured in points and the quantity of items to render
setColor
setOpacity
setTexture
sets a new texture. it will be retained
Method Detail
-
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}
-
{cc.BlendFunc} getBlendFunc()cc.AtlasNode - CocosNodeTexture protocol
- Returns:
- {cc.BlendFunc}
-
{cc.Color3B} getColor()cc.AtlasNode - RGBA protocol
- Returns:
- {cc.Color3B}
-
{Number} getQuadsToDraw()
- Returns:
- {Number}
-
{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(src, dst)BlendFunc setter
- Parameters:
- {Number | cc.BlendFunc} src
- {Number} dst
-
setOpacityModifyRGB(value)
- Parameters:
- {Boolean} value
-
setQuadsToDraw(quadsToDraw)
- Parameters:
- {Number} quadsToDraw
-
setTextureAtlas(value)
- Parameters:
- {cc.TextureAtlas} value
-
updateAtlasValues()updates the Atlas (indexed vertex array). Shall be overridden in subclasses