2011-03-19 10:59:01 +08:00
|
|
|
/****************************************************************************
|
2012-09-24 21:22:20 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2011-03-19 10:59:01 +08:00
|
|
|
Copyright (c) 2008-2009 Jason Booth
|
|
|
|
|
|
|
|
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.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ACTION_CCEASE_ACTION_H__
|
|
|
|
#define __ACTION_CCEASE_ACTION_H__
|
|
|
|
|
|
|
|
#include "CCActionInterval.h"
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_BEGIN
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
class Object;
|
2011-03-19 10:59:01 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup actions
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Base class for Easing actions
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL ActionEase : public ActionInterval
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ActionInterval* getInnerAction();
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual ActionEase* clone() const override = 0;
|
|
|
|
virtual ActionEase* reverse() const override = 0;
|
2013-07-18 07:56:19 +08:00
|
|
|
virtual void startWithTarget(Node *target) override;
|
2013-11-16 21:08:00 +08:00
|
|
|
virtual void stop() override;
|
2013-07-16 03:43:22 +08:00
|
|
|
virtual void update(float time) override;
|
|
|
|
|
2010-08-10 14:02:13 +08:00
|
|
|
protected:
|
2013-11-22 09:06:06 +08:00
|
|
|
ActionEase() {}
|
|
|
|
virtual ~ActionEase();
|
|
|
|
/** initializes the action */
|
|
|
|
bool initWithAction(ActionInterval *action);
|
|
|
|
|
2012-12-26 18:59:31 +08:00
|
|
|
/** The inner action */
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionInterval *_inner;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(ActionEase);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Base class for Easing actions with rate parameters
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseRateAction : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** set rate value for the actions */
|
2013-06-15 14:03:30 +08:00
|
|
|
inline void setRate(float rate) { _rate = rate; }
|
2012-04-19 14:35:52 +08:00
|
|
|
/** get rate value for the actions */
|
2013-11-16 21:08:00 +08:00
|
|
|
inline float getRate() const { return _rate; }
|
2010-09-28 16:18:05 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual EaseRateAction* clone() const override = 0;
|
|
|
|
virtual EaseRateAction* reverse() const override = 0;
|
2010-08-10 14:02:13 +08:00
|
|
|
|
|
|
|
protected:
|
2013-11-22 09:06:06 +08:00
|
|
|
EaseRateAction() {}
|
|
|
|
virtual ~EaseRateAction();
|
|
|
|
/** Initializes the action with the inner action and the rate parameter */
|
|
|
|
bool initWithAction(ActionInterval *pAction, float fRate);
|
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
float _rate;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseRateAction);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseIn action with a rate
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseIn : public EaseRateAction
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Creates the action with the inner action and the rate parameter */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseIn* create(ActionInterval* action, float rate);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseIn* clone() const override;
|
|
|
|
virtual EaseIn* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseIn() {}
|
|
|
|
virtual ~EaseIn() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseIn);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseOut action with a rate
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseOut : public EaseRateAction
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Creates the action with the inner action and the rate parameter */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseOut* create(ActionInterval* action, float rate);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseOut* clone() const override;
|
|
|
|
virtual EaseOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseOut() {}
|
|
|
|
virtual ~EaseOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseInOut action with a rate
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseInOut : public EaseRateAction
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Creates the action with the inner action and the rate parameter */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseInOut* create(ActionInterval* action, float rate);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseInOut* clone() const override;
|
|
|
|
virtual EaseInOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseInOut() {}
|
|
|
|
virtual ~EaseInOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseInOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief Ease Exponential In
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseExponentialIn : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
2011-03-19 10:59:01 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseExponentialIn* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseExponentialIn* clone() const override;
|
|
|
|
virtual ActionEase* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseExponentialIn() {}
|
|
|
|
virtual ~EaseExponentialIn() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseExponentialIn);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Exponential Out
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseExponentialOut : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
2011-03-19 10:59:01 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseExponentialOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseExponentialOut* clone() const override;
|
|
|
|
virtual ActionEase* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseExponentialOut() {}
|
|
|
|
virtual ~EaseExponentialOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseExponentialOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Exponential InOut
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseExponentialInOut : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-06-14 15:13:16 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseExponentialInOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseExponentialInOut* clone() const override;
|
|
|
|
virtual EaseExponentialInOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseExponentialInOut() {}
|
|
|
|
virtual ~EaseExponentialInOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseExponentialInOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Sine In
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseSineIn : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
2011-03-19 10:59:01 +08:00
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseSineIn* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseSineIn* clone() const override;
|
|
|
|
virtual ActionEase* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseSineIn() {}
|
|
|
|
virtual ~EaseSineIn() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseSineIn);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Sine Out
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseSineOut : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseSineOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseSineOut* clone() const override;
|
|
|
|
virtual ActionEase* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseSineOut() {}
|
|
|
|
virtual ~EaseSineOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseSineOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Sine InOut
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseSineInOut : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseSineInOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseSineInOut* clone() const override;
|
|
|
|
virtual EaseSineInOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseSineInOut() {}
|
|
|
|
virtual ~EaseSineInOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseSineInOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Elastic abstract class
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseElastic : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-07-16 03:43:22 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
/** get period of the wave in radians. default is 0.3 */
|
2013-11-16 21:08:00 +08:00
|
|
|
inline float getPeriod() const { return _period; }
|
2012-04-19 14:35:52 +08:00
|
|
|
/** set period of the wave in radians. */
|
2013-06-15 14:03:30 +08:00
|
|
|
inline void setPeriod(float fPeriod) { _period = fPeriod; }
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
//
|
|
|
|
// Overrides
|
|
|
|
//
|
|
|
|
virtual EaseElastic* clone() const override = 0;
|
|
|
|
virtual EaseElastic* reverse() const override = 0;
|
2012-12-06 18:51:33 +08:00
|
|
|
|
2010-08-10 14:02:13 +08:00
|
|
|
protected:
|
2013-11-22 09:06:06 +08:00
|
|
|
EaseElastic() {}
|
|
|
|
virtual ~EaseElastic() {}
|
|
|
|
/** Initializes the action with the inner action and the period in radians (default is 0.3) */
|
|
|
|
bool initWithAction(ActionInterval *action, float period = 0.3f);
|
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
float _period;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseElastic);
|
|
|
|
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Elastic In action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseElasticIn : public EaseElastic
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Creates the action with the inner action and the period in radians (default is 0.3) */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseElasticIn* create(ActionInterval *action, float period);
|
|
|
|
static EaseElasticIn* create(ActionInterval *action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseElasticIn* clone() const override;
|
|
|
|
virtual EaseElastic* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseElasticIn() {}
|
|
|
|
virtual ~EaseElasticIn() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseElasticIn);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Elastic Out action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseElasticOut : public EaseElastic
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Creates the action with the inner action and the period in radians (default is 0.3) */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseElasticOut* create(ActionInterval *action, float period);
|
|
|
|
static EaseElasticOut* create(ActionInterval *action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseElasticOut* clone() const override;
|
|
|
|
virtual EaseElastic* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseElasticOut() {}
|
|
|
|
virtual ~EaseElasticOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseElasticOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief Ease Elastic InOut action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseElasticInOut : public EaseElastic
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** Creates the action with the inner action and the period in radians (default is 0.3) */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseElasticInOut* create(ActionInterval *action, float period);
|
|
|
|
static EaseElasticInOut* create(ActionInterval *action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseElasticInOut* clone() const override;
|
|
|
|
virtual EaseElasticInOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseElasticInOut() {}
|
|
|
|
virtual ~EaseElasticInOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseElasticInOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseBounce abstract class.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBounce : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
float bounceTime(float time);
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-07-16 03:43:22 +08:00
|
|
|
// Overrides
|
|
|
|
virtual EaseBounce* clone() const override = 0;
|
|
|
|
virtual EaseBounce* reverse() const override = 0;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBounce() {}
|
|
|
|
virtual ~EaseBounce() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBounce);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseBounceIn action.
|
2010-09-28 18:27:33 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBounceIn : public EaseBounce
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseBounceIn* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseBounceIn* clone() const override;
|
|
|
|
virtual EaseBounce* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBounceIn() {}
|
|
|
|
virtual ~EaseBounceIn() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBounceIn);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
|
|
|
@brief EaseBounceOut action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBounceOut : public EaseBounce
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseBounceOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseBounceOut* clone() const override;
|
|
|
|
virtual EaseBounce* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBounceOut() {}
|
|
|
|
virtual ~EaseBounceOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBounceOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseBounceInOut action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBounceInOut : public EaseBounce
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseBounceInOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseBounceInOut* clone() const override;
|
|
|
|
virtual EaseBounceInOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBounceInOut() {}
|
|
|
|
virtual ~EaseBounceInOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBounceInOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseBackIn action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBackIn : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseBackIn* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseBackIn* clone() const override;
|
|
|
|
virtual ActionEase* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBackIn() {}
|
|
|
|
virtual ~EaseBackIn() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBackIn);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseBackOut action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBackOut : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseBackOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseBackOut* clone() const override;
|
|
|
|
virtual ActionEase* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBackOut() {}
|
|
|
|
virtual ~EaseBackOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBackOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2010-09-28 18:27:33 +08:00
|
|
|
/**
|
2013-06-20 14:13:12 +08:00
|
|
|
@brief EaseBackInOut action.
|
2012-09-17 15:02:24 +08:00
|
|
|
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
2010-08-10 14:02:13 +08:00
|
|
|
@since v0.8.2
|
2012-06-20 18:09:11 +08:00
|
|
|
@ingroup Actions
|
2010-08-10 14:02:13 +08:00
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL EaseBackInOut : public ActionEase
|
2010-08-10 14:02:13 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates the action */
|
2013-11-16 21:08:00 +08:00
|
|
|
static EaseBackInOut* create(ActionInterval* action);
|
2013-07-16 03:43:22 +08:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
virtual void update(float time) override;
|
|
|
|
virtual EaseBackInOut* clone() const override;
|
|
|
|
virtual EaseBackInOut* reverse() const override;
|
2013-11-22 09:06:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EaseBackInOut() {}
|
|
|
|
virtual ~EaseBackInOut() {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CC_DISALLOW_COPY_AND_ASSIGN(EaseBackInOut);
|
2010-08-10 14:02:13 +08:00
|
|
|
};
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of actions group
|
|
|
|
/// @}
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_END
|
2012-01-12 17:06:46 +08:00
|
|
|
|
|
|
|
#endif // __ACTION_CCEASE_ACTION_H__
|