mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-08 00:29:28 +08:00
8 lines
277 B
JavaScript
8 lines
277 B
JavaScript
--------------------------
|
|
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);
|