1, 下载sprites 图, 但是一般都是合起来一整张的
2,用PS进行切片,并保存
3,用TexturePacker去把上面的图合成两个文件, 可以给COCOS2D用
4,把这两文件放进项目里,
1),拖进res文件夹
2)在resource.js里面加入这两个文件
5,开始用Cocos2D写代码吧, 官方代码:
var AnimationLayer = cc.Layer.extend({ spriteSheet:null, runningAction:null, sprite:null, ctor:function () { this._super(); this.init(); }, init:function () { this._super(); // create sprite sheet cc.spriteFrameCache.addSpriteFrames(res.runner_plist); this