HelloWorldScene.h

zhangxm, 2011-10-17 23:24

Download (805 Bytes)

 
1
//
2
//  HelloWorldScene.h
3
//  Untitled
4
//
5
//  Created by YQ on 11-10-17.
6
//  Copyright __MyCompanyName__ 2011. All rights reserved.
7
//
8

    
9
#ifndef __HELLOWORLD_SCENE_H__
10
#define __HELLOWORLD_SCENE_H__
11

    
12
#include "cocos2d.h"
13

    
14
class HelloWorld : public cocos2d::CCLayer
15
{
16
public:
17
        // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
18
        virtual bool init();  
19

    
20
        // there's no 'id' in cpp, so we recommand to return the exactly class pointer
21
        static cocos2d::CCScene* scene();
22
        
23
        // a selector callback
24
        virtual void menuCloseCallback(CCObject* pSender);
25

    
26
        // implement the "static node()" method manually
27
        void test(CCObject* pSender);
28
        LAYER_NODE_FUNC(HelloWorld);
29
        cocos2d::CCMenuItemImage *a;
30
        cocos2d::CCMenu *menu2;
31
};
32

    
33
#endif // __HELLOWORLD_SCENE_H__