Skip to content

Instantly share code, notes, and snippets.

@kw0006667
Created October 11, 2012 04:33
Show Gist options
  • Save kw0006667/3870177 to your computer and use it in GitHub Desktop.
Save kw0006667/3870177 to your computer and use it in GitHub Desktop.
Add sprite to your scene(.h)
class HelloWorld : public cocos2d::CCLayer
{
private:
CCSprite *charlie;
float totalTime;
public:
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
// there's no 'id' in cpp, so we recommand to return the exactly class pointer
static cocos2d::CCScene* scene();
// a selector callback
void menuCloseCallback(CCObject* pSender);
// implement the "static node()" method manually
LAYER_CREATE_FUNC(HelloWorld);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment