2010-08-31 17:03:58 +08:00
|
|
|
#ifndef _LAYER_TEST_H_
|
|
|
|
#define _LAYER_TEST_H_
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
////----#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2010-08-31 17:03:58 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class LayerTest : public BaseTest
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
protected:
|
2013-06-15 14:03:30 +08:00
|
|
|
std::string _title;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
LayerTest(void);
|
|
|
|
~LayerTest(void);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
|
2013-07-26 06:53:24 +08:00
|
|
|
void restartCallback(Object* sender);
|
|
|
|
void nextCallback(Object* sender);
|
|
|
|
void backCallback(Object* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2013-02-28 16:03:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class LayerTest1 : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(LayerTest1);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void updateSize(Point &touchLocation);
|
2010-08-31 17:03:58 +08:00
|
|
|
|
2013-10-23 16:14:03 +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);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class LayerTest2 : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(LayerTest2);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LayerTestBlend : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(LayerTestBlend);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
LayerTestBlend();
|
2012-06-08 13:55:28 +08:00
|
|
|
void newBlend(float dt);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-31 17:03:58 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 13:43:40 +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);
|
2013-06-20 13:43:40 +08:00
|
|
|
LayerGradientTest();
|
2013-10-23 16:14:03 +08:00
|
|
|
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-06-20 14:17:10 +08:00
|
|
|
void toggleItem(cocos2d::Object *sender);
|
2011-02-23 16:47:25 +08:00
|
|
|
};
|
|
|
|
|
2013-06-29 10:02:10 +08:00
|
|
|
class LayerGradientTest2 : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(LayerGradientTest2);
|
2013-06-29 10:02:10 +08:00
|
|
|
LayerGradientTest2();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-06-29 10:02:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class LayerGradientTest3 : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(LayerGradientTest3);
|
2013-06-29 10:02:10 +08:00
|
|
|
LayerGradientTest3();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-06-29 10:02:10 +08:00
|
|
|
};
|
|
|
|
|
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();
|
2013-06-20 14:17:10 +08:00
|
|
|
void onToggle(Object* pObject);
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-06-20 14:17:10 +08:00
|
|
|
void onToggle(Object* pObject);
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-06-20 14:17:10 +08:00
|
|
|
void onToggle(Object* pObject);
|
2013-12-19 05:52:10 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 18:00:27 +08:00
|
|
|
};
|
|
|
|
|
2013-12-11 15:57:20 +08:00
|
|
|
class LayerBug3162A : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(LayerBug3162A);
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
|
|
|
|
void step(float dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
LayerColor* _layer[3];
|
|
|
|
};
|
|
|
|
|
|
|
|
class LayerBug3162B : public LayerTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(LayerBug3162B);
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
|
|
|
|
void step(float dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
LayerColor* _layer[3];
|
|
|
|
};
|
|
|
|
|
2010-08-31 17:03:58 +08:00
|
|
|
class LayerTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|