2010-08-06 17:50:20 +08:00
|
|
|
#ifndef _ActionsTest_H_
|
|
|
|
#define _ActionsTest_H_
|
|
|
|
|
|
|
|
#include "../testBasic.h"
|
2010-09-01 14:57:55 +08:00
|
|
|
////----#include "cocos2d.h"
|
2010-08-06 17:50:20 +08:00
|
|
|
|
|
|
|
using namespace cocos2d;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
ACTION_MANUAL_LAYER = 0,
|
|
|
|
ACTION_MOVE_LAYER,
|
|
|
|
ACTION_SCALE_LAYER,
|
2010-08-06 17:50:20 +08:00
|
|
|
ACTION_ROTATE_LAYER,
|
2010-08-09 18:07:50 +08:00
|
|
|
ACTION_JUMP_LAYER,
|
|
|
|
ACTION_BEZIER_LAYER,
|
|
|
|
ACTION_BLINK_LAYER,
|
|
|
|
ACTION_FADE_LAYER,
|
|
|
|
ACTION_TINT_LAYER,
|
|
|
|
ACTION_ANIMATE_LAYER,
|
|
|
|
ACTION_SEQUENCE_LAYER,
|
|
|
|
ACTION_SEQUENCE2_LAYER,
|
|
|
|
ACTION_SPAWN_LAYER,
|
|
|
|
ACTION_REVERSE,
|
|
|
|
ACTION_DELAYTIME_LAYER,
|
|
|
|
ACTION_REPEAT_LAYER,
|
|
|
|
ACTION_REPEATEFOREVER_LAYER,
|
|
|
|
ACTION_ROTATETOREPEATE_LAYER,
|
|
|
|
ACTION_ROTATEJERK_LAYER,
|
|
|
|
ACTION_CALLFUNC_LAYER,
|
|
|
|
ACTION_REVERSESEQUENCE_LAYER,
|
|
|
|
ACTION_REVERSESEQUENCE2_LAYER,
|
|
|
|
ACTION_ORBIT_LAYER,
|
2010-08-17 17:38:26 +08:00
|
|
|
ACTION_FLLOW_LAYER,
|
2010-08-06 17:50:20 +08:00
|
|
|
ACTION_LAYER_COUNT,
|
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
|
|
|
|
// the class inherit from TestScene
|
|
|
|
// every Scene each test used must inherit from TestScene,
|
|
|
|
// make sure the test have the menu item for back to main menu
|
|
|
|
class ActionsTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
2010-08-10 09:52:16 +08:00
|
|
|
virtual void runThisTest();
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
2010-08-06 17:50:20 +08:00
|
|
|
class ActionsDemo : public CCLayer
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
CCSprite* m_grossini;
|
|
|
|
CCSprite* m_tamara;
|
|
|
|
CCSprite* m_kathia;
public:
|
|
|
|
virtual void onEnter();
|
2010-09-13 09:40:47 +08:00
|
|
|
virtual void onExit();
|
2010-08-06 17:50:20 +08:00
|
|
|
|
|
|
|
void centerSprites(unsigned int numberOfSprites);
|
2010-08-09 18:07:50 +08:00
|
|
|
void alignSpritesLeft(unsigned int numberOfSprites);
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2010-08-06 17:50:20 +08:00
|
|
|
|
2010-08-11 09:08:34 +08:00
|
|
|
void restartCallback(NSObject* pSender);
|
|
|
|
void nextCallback(NSObject* pSender);
|
|
|
|
void backCallback(NSObject* pSender);
|
2010-08-06 17:50:20 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionManual : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionMove : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionScale : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2010-08-06 17:50:20 +08:00
|
|
|
class ActionRotate : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
2010-08-09 18:07:50 +08:00
|
|
|
virtual std::string subtitle();
|
2010-08-06 17:50:20 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionJump : public ActionsDemo
|
2010-08-06 17:50:20 +08:00
|
|
|
{
|
|
|
|
public:
|
2010-08-09 18:07:50 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
2010-08-06 17:50:20 +08:00
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionBezier : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionBlink : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionFade : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionTint : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionAnimate : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionSequence : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionSequence2 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
2010-08-11 15:54:44 +08:00
|
|
|
|
|
|
|
void callback1();
|
2010-09-03 11:10:32 +08:00
|
|
|
void callback2(CCNode* sender);
|
|
|
|
void callback3(CCNode* sender, void* data);
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionSpawn : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionReverse : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRepeat : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionDelayTime : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionReverseSequence : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionReverseSequence2 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionOrbit : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRepeatForever : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
|
|
|
|
void repeatForever(CCNode* pTarget);
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotateToRepeat : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotateJerk : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCallFunc : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
2010-08-11 15:54:44 +08:00
|
|
|
|
|
|
|
void callback1();
|
|
|
|
void callback2(CCNode* pTarget);
|
|
|
|
void callback3(CCNode* pTarget, void* data);
|
2010-08-06 17:50:20 +08:00
|
|
|
};
|
|
|
|
|
2010-08-17 17:38:26 +08:00
|
|
|
class ActionFollow : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2010-08-06 17:50:20 +08:00
|
|
|
#endif
|