cocos2d / cocos2d-js

cocos2d-x for JS
http://www.cocos2d-x.org
MIT License
1.86k stars 490 forks source link

cc.SpriteBatchNode() throw error of undefined in cocos2d-js lite v3.1 #1094

Closed owen26 closed 9 years ago

owen26 commented 9 years ago

I'm a newbie to cocos2d framework. When I follow the tutorial Parkour game from the official website, I got stuck with this chapter: http://cocos2d-x.org/docs/tutorial/framework/html5/parkour-game-with-javascript-v3.0/chapter5/en

with the code of:

// create sprite sheet
cc.spriteFrameCache.addSpriteFrames(res.runner_plist);
this.spriteSheet = new cc.SpriteBatchNode(res.runner_png);
this.addChild(this.spriteSheet);

Chrome runtime gives me an error says:

cc.SpriteBatchNode is undefined

I'm wondering if this is a bug or a missing feature on lite version of cocos2d because when I use cocos2d-JS full version, everything is fine.

dingpinglv commented 9 years ago

Cocos2d-JS lite v3.1 doesn't contain cc.SpriteBatchNode, if you want to follow the tutorial, please download the full version or select the "sprite-batch-node" module in Customized Versio. image

Thanks David