Created
October 11, 2012 04:33
-
-
Save kw0006667/3870177 to your computer and use it in GitHub Desktop.
Add sprite to your scene(.h)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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