Cocos Creator plist图集使用方法

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;
        //....省略部分代码
	}
});

你可能感兴趣的:(技术文档)