axmol/samples/Cpp/TestCpp/Classes/Box2DTestBed/Box2dView.h

66 lines
1.5 KiB
C
Raw Normal View History

#ifndef _BOX2D_VIEW_H_
#define _BOX2D_VIEW_H_
//#include "cocos2d.h"
#include "../testBasic.h"
2013-12-27 14:42:45 +08:00
#include "renderer/CCCustomCommand.h"
class MenuLayer : public Layer
{
int m_entryID;
EventListenerTouchOneByOne* _touchListener;
public:
MenuLayer(void);
virtual ~MenuLayer(void);
bool initWithEntryID(int entryId);
void restartCallback(Object* sender);
void nextCallback(Object* sender);
void backCallback(Object* sender);
bool onTouchBegan(Touch* touch, Event* event);
void onTouchMoved(Touch* touch, Event* event);
public:
static MenuLayer* menuWithEntryID(int entryId);
};
struct TestEntry;
class Test;
class Box2DView : public Layer
{
EventListenerTouchOneByOne* _touchListener;
TestEntry* m_entry;
Test* m_test;
int m_entryID;
public:
Box2DView(void);
virtual ~Box2DView(void);
bool initWithEntryID(int entryId);
std::string title() const;
2012-06-08 13:55:28 +08:00
void tick(float dt);
void draw();
// virtual void registerWithTouchDispatcher();
bool onTouchBegan(Touch* touch, Event* event);
void onTouchMoved(Touch* touch, Event* event);
void onTouchEnded(Touch* touch, Event* event);
//virtual void accelerometer(UIAccelerometer* accelerometer, Acceleration* acceleration);
static Box2DView* viewWithEntryID(int entryId);
2013-12-26 15:48:26 +08:00
protected:
2013-12-27 14:42:45 +08:00
CustomCommand _customCmd;
2013-12-26 15:48:26 +08:00
void onDraw();
};
class Box2dTestBedScene : public TestScene
{
public:
virtual void runThisTest();
};
#endif