关于从图集中取spriteFrames

cc.loader.loadRes(‘altas’,cc.SpriteAtlas,function(err,altas){
console.log(altas);
var frame = altas.getSpriteFrames();
console.log(frame);
})
为啥我输出来的是一个空的数组,很郁闷,求路过的大神们解答:6:

可能是路径设置有问题,函数内判定err != null 看一下是否出错了

err为null,说明没有错呀

你可能用的图集时cocoscreator自带的对吧

把资源放到 resources 下