axmol/tests/cpp-tests/Source/ActionsEaseTest/ActionsEaseTest.h

275 lines
6.1 KiB
C
Raw Normal View History

/****************************************************************************
Copyright (c) 2012 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
2022-10-01 16:24:52 +08:00
https://axmolengine.github.io/
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.
****************************************************************************/
#ifndef _ACTIONS__EASE_TEST_H_
#define _ACTIONS__EASE_TEST_H_
#include "../BaseTest.h"
DEFINE_TEST_SUITE(ActionsEaseTests);
class EaseSpriteDemo : public TestCase
2010-08-25 17:02:58 +08:00
{
protected:
2022-10-18 19:17:36 +08:00
ax::Sprite* _grossini;
ax::Sprite* _tamara;
ax::Sprite* _kathia;
2021-12-28 16:06:23 +08:00
std::string _title;
public:
EaseSpriteDemo();
~EaseSpriteDemo();
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
virtual void onEnter() override;
2021-12-28 16:06:23 +08:00
void centerSprites(unsigned int numberOfSprites);
void positionForTwo();
2010-08-25 17:02:58 +08:00
};
class SpriteEase : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEase);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
2012-06-12 01:43:07 +08:00
void testStopAction(float dt);
2010-08-25 17:02:58 +08:00
};
class SpriteEaseInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseExponential : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseExponential);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseExponentialInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseExponentialInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseSine : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseSine);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseSineInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseSineInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseElastic : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseElastic);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseElasticInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseElasticInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseBounce : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseBounce);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseBounceInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseBounceInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseBack : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseBack);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseBackInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseBackInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
};
class SpriteEaseBezier : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseBezier);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseQuadratic : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseQuadratic);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseQuadraticInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseQuadraticInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseQuartic : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseQuartic);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseQuarticInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseQuarticInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseQuintic : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseQuintic);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseQuinticInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseQuinticInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseCircle : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseCircle);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseCircleInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseCircleInOut);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseCubic : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseCubic);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
};
class SpriteEaseCubicInOut : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpriteEaseCubicInOut);
void onEnter() override;
virtual std::string title() const override;
};
2010-08-25 17:02:58 +08:00
class SpeedTest : public EaseSpriteDemo
{
public:
CREATE_FUNC(SpeedTest);
void onEnter() override;
2014-02-28 23:02:22 +08:00
virtual std::string subtitle() const override;
2010-08-25 17:02:58 +08:00
2012-06-12 01:43:07 +08:00
void altertime(float dt);
2010-08-25 17:02:58 +08:00
};
#endif