2014-01-14 06:48:12 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2012 cocos2d-x.org
|
|
|
|
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
|
|
|
|
|
|
|
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-03-20 18:07:42 +08:00
|
|
|
#ifndef _ACTIONS__EASE_TEST_H_
|
|
|
|
#define _ACTIONS__EASE_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"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-06-14 05:19:13 +08:00
|
|
|
USING_NS_CC;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class EaseSpriteDemo : public BaseTest
|
2010-08-25 17:02:58 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
Sprite* _grossini;
|
|
|
|
Sprite* _tamara;
|
|
|
|
Sprite* _kathia;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
std::string _title;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
EaseSpriteDemo(void);
|
|
|
|
~EaseSpriteDemo(void);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() 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
|
|
|
|
|
|
|
void positionForTwo();
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEase : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() 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:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseExponential : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseExponentialInOut : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseSine : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseSineInOut : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseElastic : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseElasticInOut : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseBounce : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseBounceInOut : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseBack : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpriteEaseBackInOut : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2010-08-25 17:02:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class SpeedTest : public EaseSpriteDemo
|
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
void onEnter();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() 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
|
|
|
};
|
|
|
|
|
2012-03-20 18:07:42 +08:00
|
|
|
class ActionsEaseTestScene : public TestScene
|
2010-08-25 17:02:58 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|