2012-09-17 14:27:17 +08:00
|
|
|
#include "CCBKeyframe.h"
|
|
|
|
|
|
|
|
using namespace cocos2d;
|
|
|
|
|
2013-10-15 18:00:03 +08:00
|
|
|
namespace cocosbuilder {
|
2012-09-17 14:27:17 +08:00
|
|
|
|
|
|
|
CCBKeyframe::CCBKeyframe()
|
2013-07-27 22:31:57 +08:00
|
|
|
: _value(NULL)
|
|
|
|
, _time(0.0f)
|
|
|
|
, _easingType(EasingType::INSTANT)
|
|
|
|
, _easingOpt(0.0f)
|
2012-09-17 14:27:17 +08:00
|
|
|
{}
|
|
|
|
|
|
|
|
CCBKeyframe::~CCBKeyframe()
|
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
CC_SAFE_RELEASE_NULL(_value);
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:15:53 +08:00
|
|
|
Object* CCBKeyframe::getValue()
|
2012-09-17 14:27:17 +08:00
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
return _value;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:15:53 +08:00
|
|
|
void CCBKeyframe::setValue(Object *pValue)
|
2012-09-17 14:27:17 +08:00
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
CC_SAFE_RELEASE(_value);
|
|
|
|
_value = pValue;
|
|
|
|
CC_SAFE_RETAIN(_value);
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
float CCBKeyframe::getTime()
|
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
return _time;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCBKeyframe::setTime(float fTime)
|
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
_time = fTime;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
2013-07-27 21:44:49 +08:00
|
|
|
CCBKeyframe::EasingType CCBKeyframe::getEasingType()
|
2012-09-17 14:27:17 +08:00
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
return _easingType;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
2013-07-27 21:44:49 +08:00
|
|
|
void CCBKeyframe::setEasingType(CCBKeyframe::EasingType easingType)
|
2012-09-17 14:27:17 +08:00
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
_easingType = easingType;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
float CCBKeyframe::getEasingOpt()
|
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
return _easingOpt;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCBKeyframe::setEasingOpt(float fEasingOpt)
|
|
|
|
{
|
2013-07-27 22:31:57 +08:00
|
|
|
_easingOpt = fEasingOpt;
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
2013-10-15 18:00:03 +08:00
|
|
|
}
|