axmol/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h

81 lines
1.5 KiB
C
Raw Normal View History

2010-09-01 14:57:55 +08:00
#ifndef _PARALLAX_TEST_H_
#define _PARALLAX_TEST_H_
#include "../testBasic.h"
#include "../BaseTest.h"
class ParallaxDemo : public BaseTest
2010-09-01 14:57:55 +08:00
{
protected:
TextureAtlas* _atlas;
2010-09-01 14:57:55 +08:00
public:
ParallaxDemo(void);
~ParallaxDemo(void);
virtual std::string title() const override;
virtual void onEnter() override;
2010-09-01 14:57:55 +08:00
void restartCallback(Ref* sender);
void nextCallback(Ref* sender);
void backCallback(Ref* sender);
2010-09-01 14:57:55 +08:00
};
class Parallax1 : public ParallaxDemo
{
protected:
Node* _root;
Node* _target;
MotionStreak* _streak;
public:
Parallax1();
virtual std::string title() const override;
2010-09-01 14:57:55 +08:00
};
class Parallax2 : public ParallaxDemo
{
protected:
Node* _root;
Node* _target;
MotionStreak* _streak;
public:
Parallax2();
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
virtual std::string title() const override;
2010-09-01 14:57:55 +08:00
};
class Issue2572 : public ParallaxDemo
{
protected:
ParallaxNode* _paraNode;
float _moveTimer;
float _addTimer;
Vector<Sprite*> _childList;
int _preListSize;
int _printCount;
float _addChildStep;
float _wholeMoveTime;
Point _wholeMoveSize;
virtual void update(float dt) override;
public:
Issue2572();
virtual std::string title() const override;
virtual std::string subtitle() const override;
};
2010-09-01 14:57:55 +08:00
class ParallaxTestScene : public TestScene
{
public:
virtual void runThisTest();
};
#endif