axmol/tests/Classes/LayerTest/LayerTest.h

225 lines
5.1 KiB
C
Raw Normal View History

2010-08-31 17:03:58 +08:00
#ifndef _LAYER_TEST_H_
#define _LAYER_TEST_H_
////----#include "cocos2d.h"
#include "../testBasic.h"
#include "../BaseTest.h"
2010-08-31 17:03:58 +08:00
class LayerTest : public BaseTest
{
protected:
std::string _title;
public:
LayerTest(void);
~LayerTest(void);
virtual std::string title() const override;
virtual std::string subtitle() const override;
virtual void onEnter();
void restartCallback(Ref* sender);
void nextCallback(Ref* sender);
void backCallback(Ref* sender);
};
2013-02-28 16:03:55 +08:00
class LayerTestCascadingOpacityA : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestCascadingOpacityA);
2013-02-28 16:03:55 +08:00
virtual void onEnter();
virtual std::string title() const override;
2013-02-28 16:03:55 +08:00
};
class LayerTestCascadingOpacityB : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestCascadingOpacityB);
2013-02-28 16:03:55 +08:00
virtual void onEnter();
virtual std::string title() const override;
2013-02-28 16:03:55 +08:00
};
class LayerTestCascadingOpacityC : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestCascadingOpacityC);
2013-02-28 16:03:55 +08:00
virtual void onEnter();
virtual std::string title() const override;
2013-02-28 16:03:55 +08:00
};
class LayerTestCascadingColorA : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestCascadingColorA);
2013-02-28 16:03:55 +08:00
virtual void onEnter();
virtual std::string title() const override;
2013-02-28 16:03:55 +08:00
};
class LayerTestCascadingColorB : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestCascadingColorB);
2013-02-28 16:03:55 +08:00
virtual void onEnter();
virtual std::string title() const override;
2013-02-28 16:03:55 +08:00
};
class LayerTestCascadingColorC : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestCascadingColorC);
2013-02-28 16:03:55 +08:00
virtual void onEnter();
virtual std::string title() const override;
2013-02-28 16:03:55 +08:00
};
class LayerTest1 : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTest1);
virtual void onEnter();
virtual std::string title() const override;
void updateSize(Point &touchLocation);
2010-08-31 17:03:58 +08:00
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event);
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event);
};
class LayerTest2 : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTest2);
virtual void onEnter();
virtual std::string title() const override;
};
class LayerTestBlend : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerTestBlend);
LayerTestBlend();
2012-06-08 13:55:28 +08:00
void newBlend(float dt);
virtual std::string title() const override;
2010-08-31 17:03:58 +08:00
};
class LayerGradientTest : public LayerTest
2011-02-23 16:47:25 +08:00
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerGradientTest);
LayerGradientTest();
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
virtual std::string title() const override;
virtual std::string subtitle() const override;
void toggleItem(cocos2d::Ref *sender);
2011-02-23 16:47:25 +08:00
};
class LayerGradientTest2 : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerGradientTest2);
LayerGradientTest2();
virtual std::string title() const override;
virtual std::string subtitle() const override;
};
class LayerGradientTest3 : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerGradientTest3);
LayerGradientTest3();
virtual std::string title() const override;
virtual std::string subtitle() const override;
};
2012-06-12 15:14:01 +08:00
class LayerIgnoreAnchorPointPos : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerIgnoreAnchorPointPos);
2012-06-12 15:14:01 +08:00
virtual void onEnter();
void onToggle(Ref* pObject);
virtual std::string title() const override;
virtual std::string subtitle() const override;
2012-06-12 15:14:01 +08:00
};
class LayerIgnoreAnchorPointRot : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerIgnoreAnchorPointRot);
2012-06-12 15:14:01 +08:00
virtual void onEnter();
void onToggle(Ref* pObject);
virtual std::string title() const override;
virtual std::string subtitle() const override;
2012-06-12 15:14:01 +08:00
};
class LayerIgnoreAnchorPointScale : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerIgnoreAnchorPointScale);
2012-06-12 15:14:01 +08:00
virtual void onEnter();
void onToggle(Ref* pObject);
virtual std::string title() const override;
virtual std::string subtitle() const override;
2012-06-12 15:14:01 +08:00
};
2012-11-20 18:00:27 +08:00
class LayerExtendedBlendOpacityTest : public LayerTest
{
public:
2013-11-14 09:36:33 +08:00
CREATE_FUNC(LayerExtendedBlendOpacityTest);
2012-11-20 18:00:27 +08:00
LayerExtendedBlendOpacityTest();
virtual std::string title() const override;
virtual std::string subtitle() const override;
2012-11-20 18:00:27 +08:00
};
class LayerBug3162A : public LayerTest
{
public:
CREATE_FUNC(LayerBug3162A);
virtual void onEnter() override;
virtual std::string title() const override;
virtual std::string subtitle() const override;
void step(float dt);
private:
LayerColor* _layer[3];
};
class LayerBug3162B : public LayerTest
{
public:
CREATE_FUNC(LayerBug3162B);
virtual void onEnter() override;
virtual std::string title() const override;
virtual std::string subtitle() const override;
void step(float dt);
private:
LayerColor* _layer[3];
};
class LayerColorOccludeBug : public LayerTest
{
public:
CREATE_FUNC(LayerColorOccludeBug);
virtual void onEnter() override;
virtual void onExit() override;
virtual std::string title() const override;
virtual std::string subtitle() const override;
private:
LayerColor* _layer;
};
2010-08-31 17:03:58 +08:00
class LayerTestScene : public TestScene
{
public:
virtual void runThisTest();
};
#endif