cc.Class({
extends: cc.Component,
properties: {
//使用的图集
stars:{
default: null,
type: cc.SpriteAtlas
},
},
onLoad: function () {
var node = new cc.Node('Ten');
node.width = 240;
node.height = 240;
var sp = node.addComponent(cc.Sprite);
//this.stars._spriteFrames 为图集对象
//对象名称:xq009 即图片名称
sp.spriteFrame = this.stars._spriteFrames.xq009;
//....省略部分代码
}
});
Cocos Creator plist图集使用方法
最新推荐文章于 2025-06-13 13:55:09 发布