2011-03-19 10:34:26 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2008-2009 Jason Booth
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
|
|
|
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
2011-03-19 10:34:26 +08:00
|
|
|
|
2014-01-07 11:25:07 +08:00
|
|
|
http://www.cocos2d-x.org
|
2011-03-19 10:34:26 +08:00
|
|
|
|
|
|
|
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.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2010-08-10 14:02:13 +08:00
|
|
|
/*
|
|
|
|
* Elastic, Back and Bounce actions based on code from:
|
|
|
|
* http://github.com/NikhilK/silverlightfx/
|
|
|
|
*
|
|
|
|
* by http://github.com/NikhilK
|
|
|
|
*/
|
2011-03-19 10:34:26 +08:00
|
|
|
|
2014-04-27 01:11:22 +08:00
|
|
|
#include "2d/CCActionEase.h"
|
|
|
|
#include "2d/CCTweenFunction.h"
|
2011-03-19 10:34:26 +08:00
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_BEGIN
|
2010-08-10 14:02:13 +08:00
|
|
|
|
|
|
|
#ifndef M_PI_X_2
|
|
|
|
#define M_PI_X_2 (float)M_PI * 2.0f
|
|
|
|
#endif
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseAction
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
bool ActionEase::initWithAction(ActionInterval *action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CCASSERT(action != nullptr, "");
|
2012-04-19 10:46:37 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ActionInterval::initWithDuration(action->getDuration()))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
_inner = action;
|
|
|
|
action->retain();
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
return true;
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
return false;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase::~ActionEase(void)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
CC_SAFE_RELEASE(_inner);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-07-18 07:56:19 +08:00
|
|
|
void ActionEase::startWithTarget(Node *target)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-07-18 07:56:19 +08:00
|
|
|
ActionInterval::startWithTarget(target);
|
2013-06-15 14:03:30 +08:00
|
|
|
_inner->startWithTarget(_target);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void ActionEase::stop(void)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_inner->stop();
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionInterval::stop();
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void ActionEase::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
_inner->update(time);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionInterval* ActionEase::getInnerAction()
|
2013-03-01 14:08:23 +08:00
|
|
|
{
|
2013-06-15 14:03:30 +08:00
|
|
|
return _inner;
|
2013-03-01 14:08:23 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseRateAction
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
bool EaseRateAction::initWithAction(ActionInterval *action, float rate)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ActionEase::initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
_rate = rate;
|
2012-04-19 14:35:52 +08:00
|
|
|
return true;
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
return false;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseRateAction::~EaseRateAction()
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EeseIn
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseIn* EaseIn::create(ActionInterval *action, float rate)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseIn *easeIn = new (std::nothrow) EaseIn();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (easeIn)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (easeIn->initWithAction(action, rate))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
easeIn->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(easeIn);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return easeIn;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseIn* EaseIn::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseIn();
|
|
|
|
a->initWithAction(_inner->clone(), _rate);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseIn::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:30:17 +08:00
|
|
|
_inner->update(tweenfunc::easeIn(time, _rate));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseIn* EaseIn::reverse() const
|
2012-05-04 16:22:50 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseIn::create(_inner->reverse(), 1 / _rate);
|
2012-05-04 16:22:50 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseOut
|
|
|
|
//
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseOut* EaseOut::create(ActionInterval *action, float rate)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseOut *easeOut = new (std::nothrow) EaseOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (easeOut)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (easeOut->initWithAction(action, rate))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
easeOut->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(easeOut);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return easeOut;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseOut* EaseOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseOut();
|
|
|
|
a->initWithAction(_inner->clone(), _rate);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::easeOut(time, _rate));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseOut* EaseOut::reverse() const
|
2012-05-04 16:22:50 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseOut::create(_inner->reverse(), 1 / _rate);
|
2012-05-04 16:22:50 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseInOut
|
|
|
|
//
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseInOut* EaseInOut::create(ActionInterval *action, float rate)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseInOut *easeInOut = new (std::nothrow) EaseInOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (easeInOut)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (easeInOut->initWithAction(action, rate))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
easeInOut->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(easeInOut);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return easeInOut;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseInOut* EaseInOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseInOut();
|
|
|
|
a->initWithAction(_inner->clone(), _rate);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseInOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::easeInOut(time, _rate));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
// InOut and OutIn are symmetrical
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseInOut* EaseInOut::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseInOut::create(_inner->reverse(), _rate);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseExponentialIn
|
|
|
|
//
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseExponentialIn* EaseExponentialIn::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseExponentialIn *ret = new (std::nothrow) EaseExponentialIn();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseExponentialIn* EaseExponentialIn::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseExponentialIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseExponentialIn::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::expoEaseIn(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase * EaseExponentialIn::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseExponentialOut::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseExponentialOut
|
|
|
|
//
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseExponentialOut* EaseExponentialOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseExponentialOut *ret = new (std::nothrow) EaseExponentialOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseExponentialOut* EaseExponentialOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseExponentialOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseExponentialOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::expoEaseOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase* EaseExponentialOut::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseExponentialIn::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseExponentialInOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseExponentialInOut* EaseExponentialInOut::create(ActionInterval *action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseExponentialInOut *ret = new (std::nothrow) EaseExponentialInOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseExponentialInOut* EaseExponentialInOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseExponentialInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseExponentialInOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::expoEaseInOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseExponentialInOut* EaseExponentialInOut::reverse() const
|
2012-05-04 16:22:50 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseExponentialInOut::create(_inner->reverse());
|
2012-05-04 16:22:50 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseSineIn
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseSineIn* EaseSineIn::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseSineIn *ret = new (std::nothrow) EaseSineIn();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseSineIn* EaseSineIn::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseSineIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseSineIn::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::sineEaseIn(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase* EaseSineIn::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseSineOut::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseSineOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseSineOut* EaseSineOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseSineOut *ret = new (std::nothrow) EaseSineOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseSineOut* EaseSineOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseSineOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseSineOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::sineEaseOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase* EaseSineOut::reverse(void) const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseSineIn::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseSineInOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseSineInOut* EaseSineInOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseSineInOut *ret = new (std::nothrow) EaseSineInOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseSineInOut* EaseSineInOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseSineInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseSineInOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::sineEaseInOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseSineInOut* EaseSineInOut::reverse() const
|
2012-05-04 16:22:50 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseSineInOut::create(_inner->reverse());
|
2012-05-04 16:22:50 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseElastic
|
|
|
|
//
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
bool EaseElastic::initWithAction(ActionInterval *action, float period/* = 0.3f*/)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ActionEase::initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
_period = period;
|
2012-04-19 14:35:52 +08:00
|
|
|
return true;
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
return false;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseElasticIn
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseElasticIn* EaseElasticIn::create(ActionInterval *action)
|
2012-11-02 10:06:48 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
return EaseElasticIn::create(action, 0.3f);
|
2012-11-02 10:06:48 +08:00
|
|
|
}
|
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseElasticIn* EaseElasticIn::create(ActionInterval *action, float period/* = 0.3f*/)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseElasticIn *ret = new (std::nothrow) EaseElasticIn();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action, period))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseElasticIn* EaseElasticIn::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseElasticIn();
|
|
|
|
a->initWithAction(_inner->clone(), _period);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseElasticIn::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-03-08 21:48:44 +08:00
|
|
|
_inner->update(tweenfunc::elasticEaseIn(time, _period));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseElastic* EaseElasticIn::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseElasticOut::create(_inner->reverse(), _period);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseElasticOut
|
|
|
|
//
|
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseElasticOut* EaseElasticOut::create(ActionInterval *action)
|
2012-11-02 10:06:48 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
return EaseElasticOut::create(action, 0.3f);
|
2012-11-02 10:06:48 +08:00
|
|
|
}
|
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseElasticOut* EaseElasticOut::create(ActionInterval *action, float period/* = 0.3f*/)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseElasticOut *ret = new (std::nothrow) EaseElasticOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action, period))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseElasticOut* EaseElasticOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseElasticOut();
|
|
|
|
a->initWithAction(_inner->clone(), _period);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseElasticOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-03-08 21:48:44 +08:00
|
|
|
_inner->update(tweenfunc::elasticEaseOut(time, _period));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseElastic* EaseElasticOut::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseElasticIn::create(_inner->reverse(), _period);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseElasticInOut
|
|
|
|
//
|
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseElasticInOut* EaseElasticInOut::create(ActionInterval *action)
|
2012-11-02 10:06:48 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
return EaseElasticInOut::create(action, 0.3f);
|
2012-11-02 10:06:48 +08:00
|
|
|
}
|
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseElasticInOut* EaseElasticInOut::create(ActionInterval *action, float period/* = 0.3f*/)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseElasticInOut *ret = new (std::nothrow) EaseElasticInOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action, period))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseElasticInOut* EaseElasticInOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseElasticInOut();
|
|
|
|
a->initWithAction(_inner->clone(), _period);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseElasticInOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-03-08 21:48:44 +08:00
|
|
|
_inner->update(tweenfunc::elasticEaseInOut(time, _period));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseElasticInOut* EaseElasticInOut::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseElasticInOut::create(_inner->reverse(), _period);
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseBounce
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseBounceIn
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseBounceIn* EaseBounceIn::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBounceIn *ret = new (std::nothrow) EaseBounceIn();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBounceIn* EaseBounceIn::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseBounceIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseBounceIn::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::bounceEaseIn(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBounce* EaseBounceIn::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseBounceOut::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseBounceOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseBounceOut* EaseBounceOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBounceOut *ret = new (std::nothrow) EaseBounceOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBounceOut* EaseBounceOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseBounceOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseBounceOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::bounceEaseOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBounce* EaseBounceOut::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseBounceIn::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseBounceInOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseBounceInOut* EaseBounceInOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBounceInOut *ret = new (std::nothrow) EaseBounceInOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBounceInOut* EaseBounceInOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseBounceInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2013-06-14 08:25:14 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseBounceInOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::bounceEaseInOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBounceInOut* EaseBounceInOut::reverse() const
|
2012-05-04 16:22:50 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseBounceInOut::create(_inner->reverse());
|
2012-05-04 16:22:50 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 10:46:37 +08:00
|
|
|
//
|
|
|
|
// EaseBackIn
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseBackIn* EaseBackIn::create(ActionInterval *action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBackIn *ret = new (std::nothrow) EaseBackIn();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBackIn* EaseBackIn::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2013-06-19 06:06:53 +08:00
|
|
|
// no copy constructor
|
2014-08-28 07:31:57 +08:00
|
|
|
auto a = new (std::nothrow) EaseBackIn();
|
2013-06-19 06:06:53 +08:00
|
|
|
a->initWithAction(_inner->clone());
|
2013-06-14 08:25:14 +08:00
|
|
|
a->autorelease();
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseBackIn::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::backEaseIn(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase* EaseBackIn::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseBackOut::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseBackOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseBackOut* EaseBackOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBackOut *ret = new (std::nothrow) EaseBackOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBackOut* EaseBackOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2013-06-19 06:06:53 +08:00
|
|
|
// no copy constructor
|
2014-08-28 07:31:57 +08:00
|
|
|
auto a = new (std::nothrow) EaseBackOut();
|
2013-06-19 06:06:53 +08:00
|
|
|
a->initWithAction(_inner->clone());
|
2013-06-14 08:25:14 +08:00
|
|
|
a->autorelease();
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseBackOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::backEaseOut(time));
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-25 18:31:55 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
ActionEase* EaseBackOut::reverse() const
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseBackIn::create(_inner->reverse());
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseBackInOut
|
|
|
|
//
|
2012-06-14 15:13:16 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
EaseBackInOut* EaseBackInOut::create(ActionInterval* action)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBackInOut *ret = new (std::nothrow) EaseBackInOut();
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
if (ret->initWithAction(action))
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
ret->autorelease();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-11-16 21:08:00 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-11-16 21:08:00 +08:00
|
|
|
return ret;
|
2012-04-19 10:46:37 +08:00
|
|
|
}
|
2010-08-10 14:02:13 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBackInOut* EaseBackInOut::clone() const
|
2013-06-14 08:25:14 +08:00
|
|
|
{
|
2013-06-19 06:06:53 +08:00
|
|
|
// no copy constructor
|
2014-08-28 07:31:57 +08:00
|
|
|
auto a = new (std::nothrow) EaseBackInOut();
|
2013-06-19 06:06:53 +08:00
|
|
|
a->initWithAction(_inner->clone());
|
2013-06-14 08:25:14 +08:00
|
|
|
a->autorelease();
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
void EaseBackInOut::update(float time)
|
2012-04-19 10:46:37 +08:00
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::backEaseInOut(time));
|
2010-08-10 14:02:13 +08:00
|
|
|
}
|
2012-04-18 18:43:45 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
EaseBackInOut* EaseBackInOut::reverse() const
|
2012-05-04 16:22:50 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
return EaseBackInOut::create(_inner->reverse());
|
2012-05-04 16:22:50 +08:00
|
|
|
}
|
|
|
|
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2014-02-17 14:44:05 +08:00
|
|
|
|
2014-02-17 11:20:01 +08:00
|
|
|
|
|
|
|
EaseBezierAction* EaseBezierAction::create(cocos2d::ActionInterval* action)
|
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseBezierAction *ret = new (std::nothrow) EaseBezierAction();
|
2014-02-17 11:20:01 +08:00
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EaseBezierAction::setBezierParamer( float p0, float p1, float p2, float p3)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_p0 = p0;
|
|
|
|
_p1 = p1;
|
|
|
|
_p2 = p2;
|
|
|
|
_p3 = p3;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseBezierAction* EaseBezierAction::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseBezierAction();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->setBezierParamer(_p0,_p1,_p2,_p3);
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseBezierAction::update(float time)
|
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::bezieratFunction(_p0,_p1,_p2,_p3,time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseBezierAction* EaseBezierAction::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseBezierAction* reverseAction = EaseBezierAction::create(_inner->reverse());
|
|
|
|
reverseAction->setBezierParamer(_p3,_p2,_p1,_p0);
|
|
|
|
return reverseAction;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuadraticActionIn
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuadraticActionIn* EaseQuadraticActionIn::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuadraticActionIn *ret = new (std::nothrow) EaseQuadraticActionIn();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuadraticActionIn* EaseQuadraticActionIn::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuadraticActionIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
2014-02-17 14:44:05 +08:00
|
|
|
|
2014-02-17 11:20:01 +08:00
|
|
|
void EaseQuadraticActionIn::update(float time)
|
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::quadraticIn(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuadraticActionIn* EaseQuadraticActionIn::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuadraticActionIn::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuadraticActionOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuadraticActionOut* EaseQuadraticActionOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuadraticActionOut *ret = new (std::nothrow) EaseQuadraticActionOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuadraticActionOut* EaseQuadraticActionOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuadraticActionOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuadraticActionOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quadraticOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuadraticActionOut* EaseQuadraticActionOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuadraticActionOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuadraticActionInOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuadraticActionInOut* EaseQuadraticActionInOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuadraticActionInOut *ret = new (std::nothrow) EaseQuadraticActionInOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuadraticActionInOut* EaseQuadraticActionInOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuadraticActionInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuadraticActionInOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quadraticInOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuadraticActionInOut* EaseQuadraticActionInOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuadraticActionInOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuarticActionIn
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuarticActionIn* EaseQuarticActionIn::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuarticActionIn *ret = new (std::nothrow) EaseQuarticActionIn();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuarticActionIn* EaseQuarticActionIn::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuarticActionIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuarticActionIn::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quartEaseIn(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuarticActionIn* EaseQuarticActionIn::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuarticActionIn::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuarticActionOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuarticActionOut* EaseQuarticActionOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuarticActionOut *ret = new (std::nothrow) EaseQuarticActionOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuarticActionOut* EaseQuarticActionOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuarticActionOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuarticActionOut::update(float time)
|
|
|
|
{
|
2014-02-17 14:44:05 +08:00
|
|
|
_inner->update(tweenfunc::quartEaseOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuarticActionOut* EaseQuarticActionOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuarticActionOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuarticActionInOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuarticActionInOut* EaseQuarticActionInOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuarticActionInOut *ret = new (std::nothrow) EaseQuarticActionInOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuarticActionInOut* EaseQuarticActionInOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuarticActionInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuarticActionInOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quartEaseInOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuarticActionInOut* EaseQuarticActionInOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuarticActionInOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuinticActionIn
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuinticActionIn* EaseQuinticActionIn::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuinticActionIn *ret = new (std::nothrow) EaseQuinticActionIn();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuinticActionIn* EaseQuinticActionIn::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuinticActionIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuinticActionIn::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quintEaseIn(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuinticActionIn* EaseQuinticActionIn::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuinticActionIn::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuinticActionOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuinticActionOut* EaseQuinticActionOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuinticActionOut *ret = new (std::nothrow) EaseQuinticActionOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuinticActionOut* EaseQuinticActionOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuinticActionOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuinticActionOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quintEaseOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuinticActionOut* EaseQuinticActionOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuinticActionOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseQuinticActionInOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseQuinticActionInOut* EaseQuinticActionInOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseQuinticActionInOut *ret = new (std::nothrow) EaseQuinticActionInOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuinticActionInOut* EaseQuinticActionInOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseQuinticActionInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseQuinticActionInOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::quintEaseInOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseQuinticActionInOut* EaseQuinticActionInOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseQuinticActionInOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseCircleActionIn
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseCircleActionIn* EaseCircleActionIn::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseCircleActionIn *ret = new (std::nothrow) EaseCircleActionIn();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCircleActionIn* EaseCircleActionIn::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseCircleActionIn();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseCircleActionIn::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::circEaseIn(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCircleActionIn* EaseCircleActionIn::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseCircleActionIn::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseCircleActionOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseCircleActionOut* EaseCircleActionOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseCircleActionOut *ret = new (std::nothrow) EaseCircleActionOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCircleActionOut* EaseCircleActionOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseCircleActionOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseCircleActionOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::circEaseOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCircleActionOut* EaseCircleActionOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseCircleActionOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseCircleActionInOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseCircleActionInOut* EaseCircleActionInOut::create(ActionInterval* action)
|
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
EaseCircleActionInOut *ret = new (std::nothrow) EaseCircleActionInOut();
|
2014-02-17 11:20:01 +08:00
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
EaseCircleActionInOut* EaseCircleActionInOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseCircleActionInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseCircleActionInOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::circEaseInOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCircleActionInOut* EaseCircleActionInOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseCircleActionInOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseCubicActionIn
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseCubicActionIn* EaseCubicActionIn::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseCubicActionIn *ret = new (std::nothrow) EaseCubicActionIn();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCubicActionIn* EaseCubicActionIn::clone() const
|
|
|
|
{
|
|
|
|
// no copy constructor
|
2014-08-28 07:31:57 +08:00
|
|
|
auto a = new (std::nothrow) EaseCubicActionIn();
|
2014-02-17 11:20:01 +08:00
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EaseCubicActionIn::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::cubicEaseIn(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCubicActionIn* EaseCubicActionIn::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseCubicActionIn::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseCubicActionOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseCubicActionOut* EaseCubicActionOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseCubicActionOut *ret = new (std::nothrow) EaseCubicActionOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCubicActionOut* EaseCubicActionOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseCubicActionOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseCubicActionOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::cubicEaseOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCubicActionOut* EaseCubicActionOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseCubicActionOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// EaseCubicActionInOut
|
|
|
|
//
|
|
|
|
|
|
|
|
EaseCubicActionInOut* EaseCubicActionInOut::create(ActionInterval* action)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
EaseCubicActionInOut *ret = new (std::nothrow) EaseCubicActionInOut();
|
|
|
|
if (ret)
|
|
|
|
{
|
|
|
|
if (ret->initWithAction(action))
|
|
|
|
{
|
|
|
|
ret->autorelease();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(ret);
|
|
|
|
}
|
|
|
|
}
|
2014-02-17 11:20:01 +08:00
|
|
|
|
2015-01-08 10:22:45 +08:00
|
|
|
return ret;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCubicActionInOut* EaseCubicActionInOut::clone() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
// no copy constructor
|
|
|
|
auto a = new (std::nothrow) EaseCubicActionInOut();
|
|
|
|
a->initWithAction(_inner->clone());
|
|
|
|
a->autorelease();
|
|
|
|
return a;
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void EaseCubicActionInOut::update(float time)
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
_inner->update(tweenfunc::cubicEaseInOut(time));
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
EaseCubicActionInOut* EaseCubicActionInOut::reverse() const
|
|
|
|
{
|
2015-01-08 10:22:45 +08:00
|
|
|
return EaseCubicActionInOut::create(_inner->reverse());
|
2014-02-17 11:20:01 +08:00
|
|
|
}
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_END
|