2013-12-05 08:26:21 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2013 cocos2d-x.org
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2013-12-05 08:26:21 +08:00
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _SPRITE_TEST_H_
|
|
|
|
#define _SPRITE_TEST_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
#include <string>
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(SpriteTests);
|
|
|
|
|
|
|
|
class SpriteTestDemo : public TestCase
|
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:
|
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
void addNewSpriteWithCoords(cocos2d::Vec2 p);
|
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::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();
|
2015-04-09 08:37:30 +08:00
|
|
|
void addNewSpriteWithCoords(cocos2d::Vec2 p);
|
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
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
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteZOrder : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
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);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int _dir;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeZOrder: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
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);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int _dir;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* makeSpriteZ(int aZ);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::SpriteBatchNode* batchNode;
|
|
|
|
cocos2d::Sprite* sprite1;
|
|
|
|
cocos2d::Sprite* sprite2;
|
|
|
|
cocos2d::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();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprites(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteZVertex: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteZVertex);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteZVertex();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int _dir;
|
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeZVertex: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteBatchNodeZVertex);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
SpriteBatchNodeZVertex();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int _dir;
|
|
|
|
float _time;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
2015-12-14 23:17:41 +08:00
|
|
|
class SpriteAnchorPointFromFile : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteAnchorPointFromFile);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
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();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteNewTexture : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
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();
|
2015-04-09 08:37:30 +08:00
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool _usingTexture1;
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Texture2D* _texture1;
|
|
|
|
cocos2d::Texture2D* _texture2;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteBatchNodeNewTexture : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
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();
|
2015-04-09 08:37:30 +08:00
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Texture2D* _texture1;
|
|
|
|
cocos2d::Texture2D* _texture2;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteFrameTest: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteFrameTest);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
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
|
|
|
|
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
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _sprite1;
|
|
|
|
cocos2d::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);
|
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
2014-08-01 14:39:45 +08:00
|
|
|
class SpriteFramesFromFileContent : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2015-09-29 22:50:14 +08:00
|
|
|
CREATE_FUNC(SpriteFramesFromFileContent);
|
2014-08-01 14:39:45 +08:00
|
|
|
|
2015-09-29 22:50:14 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void onExit() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-09-29 21:44:13 +08:00
|
|
|
virtual std::string sheetName() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpritePolygonFromFileContent : public SpriteFramesFromFileContent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpritePolygonFromFileContent);
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual std::string sheetName() const override;
|
2014-08-01 14:39:45 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class SpriteOffsetAnchorRotation: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:36:33 +08:00
|
|
|
CREATE_FUNC(SpriteOffsetAnchorRotation);
|
|
|
|
|
2015-12-15 21:14:09 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteOffsetAnchorSkew();
|
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
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteOffsetAnchorRotationalSkew();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 15:19:57 +08:00
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeOffsetAnchorSkew();
|
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
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteOffsetAnchorRotationalSkewScale();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 15:19:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeOffsetAnchorRotationalSkew();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 15:19:57 +08:00
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteOffsetAnchorSkewScale();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeOffsetAnchorSkewScale();
|
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
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeOffsetAnchorRotationalSkewScale();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 15:19:57 +08:00
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteOffsetAnchorFlip();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeOffsetAnchorFlip();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteHybrid: public SpriteTestDemo
|
|
|
|
{
|
|
|
|
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);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool _usingSpriteBatchNode;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteChildrenVisibilityIssue665();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
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();
|
2016-06-12 02:45:38 +08:00
|
|
|
virtual ~AnimationCacheTest();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Node* _node;
|
|
|
|
cocos2d::Sprite* _sprite1;
|
|
|
|
cocos2d::Sprite* _sprite2;
|
|
|
|
cocos2d::Sprite* _sprite3;
|
|
|
|
cocos2d::Sprite* _sprite4;
|
|
|
|
cocos2d::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();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-06-08 13:55:28 +08:00
|
|
|
void reorderSprite(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::SpriteBatchNode* _batchNode;
|
|
|
|
cocos2d::Sprite* _sprite1;
|
|
|
|
cocos2d::Sprite* _sprite2;
|
|
|
|
cocos2d::Sprite* _sprite3;
|
|
|
|
cocos2d::Sprite* _sprite4;
|
|
|
|
cocos2d::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);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::SpriteBatchNode* _batchNode;
|
|
|
|
cocos2d::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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeSkewNegativeScaleChildren();
|
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
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteBatchNodeRotationalSkewNegativeScaleChildren();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 15:19:57 +08:00
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteSkewNegativeScaleChildren();
|
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
|
|
|
};
|
|
|
|
|
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();
|
2014-01-03 07:51:26 +08:00
|
|
|
virtual ~SpriteRotationalSkewNegativeScaleChildren();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-20 15:19:57 +08:00
|
|
|
};
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
2016-06-12 02:45:38 +08:00
|
|
|
virtual ~AnimationCacheFile();
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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();
|
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
|
|
|
};
|
|
|
|
|
2014-02-23 09:47:56 +08:00
|
|
|
class SpriteCullTest1 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteCullTest1);
|
|
|
|
SpriteCullTest1();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteCullTest2 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteCullTest2);
|
|
|
|
SpriteCullTest2();
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2014-07-02 03:36:53 +08:00
|
|
|
class Sprite3DRotationTest : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(Sprite3DRotationTest);
|
|
|
|
Sprite3DRotationTest();
|
|
|
|
virtual std::string title() const override { return "3D Rotation Test"; };
|
|
|
|
virtual std::string subtitle() const override { return "Rotation should based on the anchor point"; };
|
|
|
|
|
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* sprite1;
|
|
|
|
cocos2d::Sprite* sprite2;
|
2014-07-02 03:36:53 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Vec3 rotation;
|
2014-07-02 03:36:53 +08:00
|
|
|
};
|
|
|
|
|
2016-10-27 09:45:40 +08:00
|
|
|
class SpriteSlice9Test1 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test1);
|
|
|
|
SpriteSlice9Test1();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #1"; };
|
|
|
|
virtual std::string subtitle() const override { return "Testing Sprite::create()"; };
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test2 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test2);
|
|
|
|
SpriteSlice9Test2();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #2"; };
|
|
|
|
virtual std::string subtitle() const override { return "Testing Sprite::createWithSpriteFrameName()"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test3 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test3);
|
|
|
|
SpriteSlice9Test3();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #3"; };
|
|
|
|
virtual std::string subtitle() const override { return "Testing scaling a button"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test4 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test4);
|
|
|
|
SpriteSlice9Test4();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #4"; };
|
|
|
|
virtual std::string subtitle() const override { return "Testing scaling a button"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test5 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test5);
|
|
|
|
SpriteSlice9Test5();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #5"; };
|
|
|
|
virtual std::string subtitle() const override { return "Changing setCenterRect in runtime"; }
|
|
|
|
|
|
|
|
virtual void update(float dt) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
cocos2d::Sprite* _sprites[3];
|
|
|
|
float _elapsed;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test6 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test6);
|
|
|
|
SpriteSlice9Test6();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #6"; };
|
|
|
|
virtual std::string subtitle() const override { return "Changing setCenterRect in runtime #2"; }
|
|
|
|
|
|
|
|
virtual void update(float dt) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
cocos2d::Sprite* _sprites[3];
|
|
|
|
float _elapsed;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test7 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test7);
|
|
|
|
SpriteSlice9Test7();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #7"; };
|
2016-10-30 08:52:33 +08:00
|
|
|
virtual std::string subtitle() const override { return "Offset"; }
|
2016-10-27 09:45:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test8 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test8);
|
|
|
|
SpriteSlice9Test8();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #8"; };
|
2016-10-30 08:52:33 +08:00
|
|
|
virtual std::string subtitle() const override { return "Flipped sprites"; }
|
2016-10-27 09:45:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteSlice9Test9 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test9);
|
|
|
|
SpriteSlice9Test9();
|
|
|
|
virtual std::string title() const override { return "Slice 9 Test #9"; };
|
2016-10-30 08:52:33 +08:00
|
|
|
virtual std::string subtitle() const override { return "Flipped sprites #2"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SpriteSlice9Test10 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteSlice9Test10);
|
|
|
|
SpriteSlice9Test10();
|
|
|
|
virtual std::string title() const override { return "Slice 10 Test #9"; };
|
|
|
|
virtual std::string subtitle() const override { return "Rotated Sprites"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SpriteGetSpriteFrameTest : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(SpriteGetSpriteFrameTest);
|
|
|
|
SpriteGetSpriteFrameTest();
|
|
|
|
virtual std::string title() const override { return "Sprite::getSpriteFrame(*)"; };
|
|
|
|
virtual std::string subtitle() const override { return "setting after getting should be the same"; }
|
2016-10-27 09:45:40 +08:00
|
|
|
};
|
|
|
|
|
2017-01-10 15:28:47 +08:00
|
|
|
class Issue17119 : public SpriteTestDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(Issue17119);
|
|
|
|
Issue17119();
|
|
|
|
virtual std::string title() const override { return "Issue 17119"; };
|
|
|
|
virtual std::string subtitle() const override { return "flipping should work ok"; }
|
|
|
|
|
|
|
|
virtual void update(float dt) override;
|
|
|
|
protected:
|
|
|
|
float _accum;
|
|
|
|
cocos2d::Sprite* _s1;
|
|
|
|
cocos2d::Sprite* _s2;
|
|
|
|
cocos2d::Sprite* _s3;
|
|
|
|
cocos2d::Sprite* _s4;
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
#endif
|