2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _SPRITE_TEST_H_
|
|
|
|
#define _SPRITE_TEST_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
#include <string>
|
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class SpriteTestDemo : 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:
|
|
|
|
SpriteTestDemo(void);
|
|
|
|
~SpriteTestDemo(void);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
class Sprite1 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(Sprite1);
|
2012-04-19 14:35:52 +08:00
|
|
|
Sprite1();
|
|
|
|
virtual std::string title();
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void addNewSpriteWithCoords(Point p);
|
2013-09-03 18:22:03 +08:00
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNode1: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNode1);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNode1();
|
2013-06-20 14:17:10 +08:00
|
|
|
void addNewSpriteWithCoords(Point p);
|
2013-10-23 16:14:03 +08:00
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteColorOpacity : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteColorOpacity);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteColorOpacity();
|
2012-06-08 13:55:28 +08:00
|
|
|
void removeAndAddSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeColorOpacity : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeColorOpacity);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeColorOpacity();
|
2012-06-08 13:55:28 +08:00
|
|
|
void removeAndAddSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteZOrder : public SpriteTestDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
int _dir;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteZOrder);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteZOrder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeZOrder: public SpriteTestDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
int _dir;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeZOrder);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeZOrder();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeReorder : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeReorder);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeReorder();
|
|
|
|
virtual std::string title();
|
|
|
|
std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeReorderIssue744: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeReorderIssue744);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeReorderIssue744();
|
|
|
|
virtual std::string title();
|
|
|
|
std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeReorderIssue766 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeReorderIssue766);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeReorderIssue766();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* makeSpriteZ(int aZ);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
SpriteBatchNode *batchNode;
|
|
|
|
Sprite *sprite1;
|
|
|
|
Sprite *sprite2;
|
|
|
|
Sprite *sprite3;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeReorderIssue767 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeReorderIssue767);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeReorderIssue767();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprites(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteZVertex: public SpriteTestDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
int _dir;
|
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteZVertex);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
SpriteZVertex();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeZVertex: public SpriteTestDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
int _dir;
|
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeZVertex);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
SpriteBatchNodeZVertex();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteAnchorPoint : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteAnchorPoint);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteAnchorPoint();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeAnchorPoint : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeAnchorPoint);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeAnchorPoint();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class Sprite6 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(Sprite6);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
Sprite6();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteFlip : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteFlip);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteFlip();
|
2012-06-08 13:55:28 +08:00
|
|
|
void flipSprites(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeFlip : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeFlip);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeFlip();
|
2012-06-08 13:55:28 +08:00
|
|
|
void flipSprites(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteAliased : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteAliased);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteAliased();
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeAliased : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeAliased);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeAliased();
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteNewTexture : public SpriteTestDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
bool _usingTexture1;
|
2013-06-20 14:17:10 +08:00
|
|
|
Texture2D* _texture1;
|
|
|
|
Texture2D* _texture2;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteNewTexture);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteNewTexture();
|
|
|
|
virtual ~SpriteNewTexture();
|
|
|
|
void addNewSprite();
|
2013-09-03 18:22:03 +08:00
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeNewTexture : public SpriteTestDemo
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Texture2D* _texture1;
|
|
|
|
Texture2D* _texture2;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeNewTexture);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeNewTexture();
|
|
|
|
virtual ~SpriteBatchNodeNewTexture();
|
|
|
|
void addNewSprite();
|
2013-09-03 18:22:03 +08:00
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteFrameTest: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteFrameTest);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
|
2012-06-08 13:55:28 +08:00
|
|
|
void startIn05Secs(float dt);
|
|
|
|
void flipSprites(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
private:
|
2013-11-14 09:36:33 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite *_sprite1;
|
|
|
|
Sprite *_sprite2;
|
2013-06-15 14:03:30 +08:00
|
|
|
int _counter;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteFrameAliasNameTest : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteFrameAliasNameTest);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteOffsetAnchorRotation: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorRotation);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteOffsetAnchorRotation();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeOffsetAnchorRotation: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorRotation);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorRotation();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteOffsetAnchorScale: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorScale);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteOffsetAnchorScale();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeOffsetAnchorScale: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorScale);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorScale();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteOffsetAnchorSkew : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorSkew);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteOffsetAnchorSkew();
|
|
|
|
~SpriteOffsetAnchorSkew();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-11-20 15:19:57 +08:00
|
|
|
class SpriteOffsetAnchorRotationalSkew : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorRotationalSkew);
|
2012-11-20 15:19:57 +08:00
|
|
|
SpriteOffsetAnchorRotationalSkew();
|
|
|
|
~SpriteOffsetAnchorRotationalSkew();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class SpriteBatchNodeOffsetAnchorSkew : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorSkew);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorSkew();
|
|
|
|
~SpriteBatchNodeOffsetAnchorSkew();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-11-20 15:19:57 +08:00
|
|
|
class SpriteOffsetAnchorRotationalSkewScale : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorRotationalSkewScale);
|
2012-11-20 15:19:57 +08:00
|
|
|
SpriteOffsetAnchorRotationalSkewScale();
|
|
|
|
~SpriteOffsetAnchorRotationalSkewScale();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeOffsetAnchorRotationalSkew : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorRotationalSkew);
|
2012-11-20 15:19:57 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorRotationalSkew();
|
|
|
|
~SpriteBatchNodeOffsetAnchorRotationalSkew();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class SpriteOffsetAnchorSkewScale : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorSkewScale);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteOffsetAnchorSkewScale();
|
|
|
|
~SpriteOffsetAnchorSkewScale();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeOffsetAnchorSkewScale : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorSkewScale);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorSkewScale();
|
|
|
|
~SpriteBatchNodeOffsetAnchorSkewScale();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-11-20 15:19:57 +08:00
|
|
|
class SpriteBatchNodeOffsetAnchorRotationalSkewScale : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorRotationalSkewScale);
|
2012-11-20 15:19:57 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorRotationalSkewScale();
|
|
|
|
~SpriteBatchNodeOffsetAnchorRotationalSkewScale();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class SpriteOffsetAnchorFlip : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorFlip);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteOffsetAnchorFlip();
|
|
|
|
~SpriteOffsetAnchorFlip();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeOffsetAnchorFlip : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeOffsetAnchorFlip);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeOffsetAnchorFlip();
|
|
|
|
~SpriteBatchNodeOffsetAnchorFlip();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteAnimationSplit : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteAnimationSplit);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteAnimationSplit();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteHybrid: public SpriteTestDemo
|
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
bool _usingSpriteBatchNode;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteHybrid);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteHybrid();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reparentSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual void onExit();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeChildren: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeChildren);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeChildren();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeChildrenZ : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeChildrenZ);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeChildrenZ();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteChildrenVisibility: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteChildrenVisibility);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteChildrenVisibility();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteChildrenVisibilityIssue665 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteChildrenVisibilityIssue665);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteChildrenVisibilityIssue665();
|
|
|
|
~SpriteChildrenVisibilityIssue665();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteChildrenAnchorPoint: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteChildrenAnchorPoint);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteChildrenAnchorPoint();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeChildrenAnchorPoint: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeChildrenAnchorPoint);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeChildrenAnchorPoint();
|
|
|
|
virtual void onExit();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeChildrenScale: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeChildrenScale);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeChildrenScale();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteChildrenChildren: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteChildrenChildren);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteChildrenChildren();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SpriteBatchNodeChildrenChildren: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeChildrenChildren);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeChildrenChildren();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteNilTexture: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteNilTexture);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteNilTexture();
|
|
|
|
virtual std::string title();
|
|
|
|
std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSubclass : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteSubclass);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteSubclass();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2013-06-20 14:04:44 +08:00
|
|
|
class AnimationCacheTest : public SpriteTestDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(AnimationCacheTest);
|
2013-06-20 14:04:44 +08:00
|
|
|
AnimationCacheTest();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class NodeSort : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(NodeSort);
|
2012-04-19 14:35:52 +08:00
|
|
|
NodeSort();
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
Node *_node;
|
|
|
|
Sprite *_sprite1;
|
|
|
|
Sprite *_sprite2;
|
|
|
|
Sprite *_sprite3;
|
|
|
|
Sprite *_sprite4;
|
|
|
|
Sprite *_sprite5;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeReorderSameIndex : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeReorderSameIndex);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeReorderSameIndex();
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
SpriteBatchNode *_batchNode;
|
|
|
|
Sprite *_sprite1;
|
|
|
|
Sprite *_sprite2;
|
|
|
|
Sprite *_sprite3;
|
|
|
|
Sprite *_sprite4;
|
|
|
|
Sprite *_sprite5;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeReorderOneChild : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeReorderOneChild);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeReorderOneChild();
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual std::string title();
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
SpriteBatchNode *_batchNode;
|
|
|
|
Sprite *_reorderSprite;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeSkewNegativeScaleChildren : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeSkewNegativeScaleChildren);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeSkewNegativeScaleChildren();
|
|
|
|
~SpriteBatchNodeSkewNegativeScaleChildren();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2012-11-20 15:19:57 +08:00
|
|
|
class SpriteBatchNodeRotationalSkewNegativeScaleChildren : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeRotationalSkewNegativeScaleChildren);
|
2012-11-20 15:19:57 +08:00
|
|
|
SpriteBatchNodeRotationalSkewNegativeScaleChildren();
|
|
|
|
~SpriteBatchNodeRotationalSkewNegativeScaleChildren();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class SpriteSkewNegativeScaleChildren : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteSkewNegativeScaleChildren);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteSkewNegativeScaleChildren();
|
|
|
|
~SpriteSkewNegativeScaleChildren();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2012-11-20 15:19:57 +08:00
|
|
|
class SpriteRotationalSkewNegativeScaleChildren : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteRotationalSkewNegativeScaleChildren);
|
2012-11-20 15:19:57 +08:00
|
|
|
SpriteRotationalSkewNegativeScaleChildren();
|
|
|
|
~SpriteRotationalSkewNegativeScaleChildren();
|
|
|
|
virtual std::string title();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class SpriteDoubleResolution : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteDoubleResolution);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteDoubleResolution();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AnimationCacheFile : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(AnimationCacheFile);
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
AnimationCacheFile();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchBug1217 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchBug1217);
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchBug1217();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|