Class cc.TextureAtlas#ctor
- Defined in: CCTextureAtlas.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
cc.TextureAtlas#ctor(fileName, capacity)
Creates a TextureAtlas with an filename and with an initial capacity for Quads. |
Class Detail
cc.TextureAtlas#ctor(fileName, capacity)
Creates a TextureAtlas with an filename and with an initial capacity for Quads.
The TextureAtlas capacity can be increased in runtime.
1.
//creates a TextureAtlas with filename
var textureAtlas = new cc.TextureAtlas("res/hello.png", 3);
2.
//creates a TextureAtlas with texture
var texture = cc.textureCache.addImage("hello.png");
var textureAtlas = new cc.TextureAtlas(texture, 3);
- Parameters:
- {String|cc.Texture2D} fileName
- {Number} capacity