axmol/cocos/2d/CCTweenFunction.h

149 lines
4.0 KiB
C
Raw Normal View History

2013-06-06 12:02:54 +08:00
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
2013-06-06 12:02:54 +08:00
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCTWEENFUNCTION_H__
#define __CCTWEENFUNCTION_H__
#include "CCPlatformMacros.h"
2014-02-17 12:33:48 +08:00
#include "ccMacros.h"
2013-06-06 12:02:54 +08:00
#include <math.h>
NS_CC_BEGIN
2013-09-13 18:07:37 +08:00
namespace tweenfunc {
enum TweenType
{
CUSTOM_EASING = -1,
Linear,
Sine_EaseIn,
Sine_EaseOut,
Sine_EaseInOut,
Quad_EaseIn,
Quad_EaseOut,
Quad_EaseInOut,
Cubic_EaseIn,
Cubic_EaseOut,
Cubic_EaseInOut,
Quart_EaseIn,
Quart_EaseOut,
Quart_EaseInOut,
Quint_EaseIn,
Quint_EaseOut,
Quint_EaseInOut,
Expo_EaseIn,
Expo_EaseOut,
Expo_EaseInOut,
Circ_EaseIn,
Circ_EaseOut,
Circ_EaseInOut,
Elastic_EaseIn,
Elastic_EaseOut,
Elastic_EaseInOut,
Back_EaseIn,
Back_EaseOut,
Back_EaseInOut,
Bounce_EaseIn,
Bounce_EaseOut,
Bounce_EaseInOut,
TWEEN_EASING_MAX = 10000
};
//tween functions for CCActionEase
float easeIn(float time, float rate);
float easeOut(float time, float rate);
float easeInOut(float time, float rate);
float bezieratFunction( float a, float b, float c, float d, float t );
float quadraticIn(float time);
float quadraticOut(float time);
float quadraticInOut(float time);
2014-02-17 12:33:48 +08:00
float tweenTo(float time, TweenType type, float *easingParam);
float linear(float time);
2014-02-17 12:33:48 +08:00
float sineEaseIn(float time);
float sineEaseOut(float time);
float sineEaseInOut(float time);
float quadEaseIn(float time);
float quadEaseOut(float time);
float quadEaseInOut(float time);
float cubicEaseIn(float time);
float cubicEaseOut(float time);
float cubicEaseInOut(float time);
float quartEaseIn(float time);
float quartEaseOut(float time);
float quartEaseInOut(float time);
float quintEaseIn(float time);
float quintEaseOut(float time);
float quintEaseInOut(float time);
float expoEaseIn(float time);
float expoEaseOut(float time);
float expoEaseInOut(float time);
float circEaseIn(float time);
float circEaseOut(float time);
float circEaseInOut(float time);
float elasticEaseIn(float time, float *easingParam);
float elasticEaseOut(float time, float *easingParam);
float elasticEaseInOut(float time, float *easingParam);
float backEaseIn(float time);
float backEaseOut(float time);
float backEaseInOut(float time);
float bounceEaseIn(float time);
float bounceEaseOut(float time);
float bounceEaseInOut(float time);
float customEase(float time, float *easingParam);
}
2013-09-13 18:07:37 +08:00
NS_CC_END
2013-06-06 12:02:54 +08:00
#endif /*__CCTWEENFUNCTION_H__*/