2012-03-21 13:36:24 +08:00
|
|
|
#ifndef _NODE_TEST_H_
|
|
|
|
#define _NODE_TEST_H_
|
|
|
|
|
|
|
|
////----#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-03-21 13:36:24 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class TestCocosNodeDemo : public BaseTest
|
2010-08-26 15:09:02 +08:00
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
TestCocosNodeDemo(void);
|
|
|
|
~TestCocosNodeDemo(void);
|
2012-03-21 13:36:24 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2013-07-26 06:53:24 +08:00
|
|
|
void restartCallback(Object* sender);
|
|
|
|
void nextCallback(Object* sender);
|
|
|
|
void backCallback(Object* sender);
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Test2 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Test4 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
Test4();
|
2012-06-08 13:55:28 +08:00
|
|
|
void delay2(float dt);
|
|
|
|
void delay4(float dt);
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Test5 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
Test5();
|
2012-06-08 13:55:28 +08:00
|
|
|
void addAndRemove(float dt);
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Test6 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
Test6();
|
2012-06-08 13:55:28 +08:00
|
|
|
void addAndRemove(float dt);
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class StressTest1 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-06-08 13:55:28 +08:00
|
|
|
void shouldNotCrash(float dt);
|
2013-06-20 14:17:10 +08:00
|
|
|
void removeMe(Node* node);
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
StressTest1();
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class StressTest2 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-06-08 13:55:28 +08:00
|
|
|
void shouldNotLeak(float dt);
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
StressTest2();
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SchedulerTest1 : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
SchedulerTest1();
|
2012-06-08 13:55:28 +08:00
|
|
|
void doSomething(float dt);
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class NodeToWorld : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
NodeToWorld();
|
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CameraOrbitTest : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
CameraOrbitTest();
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CameraZoomTest : public TestCocosNodeDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
float _z;
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
CameraZoomTest();
|
2012-06-08 13:55:28 +08:00
|
|
|
void update(float dt);
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
2010-08-26 15:09:02 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CameraCenterTest : public TestCocosNodeDemo
|
|
|
|
{
|
2012-03-21 13:36:24 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
CameraCenterTest();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-08-26 15:09:02 +08:00
|
|
|
};
|
|
|
|
|
2011-02-23 16:47:25 +08:00
|
|
|
class ConvertToNode : public TestCocosNodeDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ConvertToNode();
|
2013-06-20 14:17:10 +08:00
|
|
|
virtual void ccTouchesEnded(Set* touches, Event *event);
|
2011-02-23 16:47:25 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2012-03-21 13:36:24 +08:00
|
|
|
class NodeOpaqueTest : public TestCocosNodeDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
NodeOpaqueTest();
|
2012-03-21 13:36:24 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class NodeNonOpaqueTest : public TestCocosNodeDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
NodeNonOpaqueTest();
|
2012-03-21 13:36:24 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2010-08-26 15:09:02 +08:00
|
|
|
class CocosNodeTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
//CCLayer* nextAction();
|
|
|
|
|
|
|
|
#endif
|