2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _BOX2D_VIEW_H_
|
|
|
|
#define _BOX2D_VIEW_H_
|
|
|
|
|
|
|
|
//#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
class MenuLayer : public Layer
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
int m_entryID;
|
|
|
|
|
|
|
|
public:
|
|
|
|
MenuLayer(void);
|
|
|
|
virtual ~MenuLayer(void);
|
|
|
|
|
|
|
|
bool initWithEntryID(int entryId);
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void restartCallback(Object* sender);
|
|
|
|
void nextCallback(Object* sender);
|
|
|
|
void backCallback(Object* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual void registerWithTouchDispatcher();
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
virtual bool ccTouchBegan(Touch* touch, Event* event);
|
|
|
|
virtual void ccTouchMoved(Touch* touch, Event* event);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
static MenuLayer* menuWithEntryID(int entryId);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TestEntry;
|
|
|
|
class Test;
|
2013-06-20 14:17:10 +08:00
|
|
|
class Box2DView : public Layer
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
TestEntry* m_entry;
|
|
|
|
Test* m_test;
|
|
|
|
int m_entryID;
|
|
|
|
public:
|
|
|
|
Box2DView(void);
|
|
|
|
virtual ~Box2DView(void);
|
|
|
|
|
|
|
|
bool initWithEntryID(int entryId);
|
|
|
|
std::string title();
|
2012-06-08 13:55:28 +08:00
|
|
|
void tick(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
void draw();
|
|
|
|
|
|
|
|
virtual void registerWithTouchDispatcher();
|
2013-06-20 14:17:10 +08:00
|
|
|
virtual bool ccTouchBegan(Touch* touch, Event* event);
|
|
|
|
virtual void ccTouchMoved(Touch* touch, Event* event);
|
|
|
|
virtual void ccTouchEnded(Touch* touch, Event* event);
|
|
|
|
//virtual void accelerometer(UIAccelerometer* accelerometer, Acceleration* acceleration);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
static Box2DView* viewWithEntryID(int entryId);
|
|
|
|
};
|
|
|
|
|
|
|
|
class Box2dTestBedScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|