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-12-09 17:45:24 +08:00
|
|
|
: _time(0.0f)
|
2013-07-27 22:31:57 +08:00
|
|
|
, _easingType(EasingType::INSTANT)
|
|
|
|
, _easingOpt(0.0f)
|
2013-12-09 17:45:24 +08:00
|
|
|
, _object(nullptr)
|
2012-09-17 14:27:17 +08:00
|
|
|
{}
|
|
|
|
|
|
|
|
CCBKeyframe::~CCBKeyframe()
|
|
|
|
{
|
2013-12-09 17:45:24 +08:00
|
|
|
CC_SAFE_RELEASE(_object);
|
2012-09-17 14:27:17 +08:00
|
|
|
}
|
|
|
|
|
2013-12-09 17:45:24 +08:00
|
|
|
const Value& CCBKeyframe::getValue() const
|
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-12-09 17:45:24 +08:00
|
|
|
void CCBKeyframe::setValue(const Value& value)
|
2012-09-17 14:27:17 +08:00
|
|
|
{
|
2013-12-09 17:45:24 +08:00
|
|
|
_value = value;
|
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
Ref* CCBKeyframe::getObject() const
|
2013-12-09 17:45:24 +08:00
|
|
|
{
|
|
|
|
return _object;
|
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void CCBKeyframe::setObject(Ref* obj)
|
2013-12-09 17:45:24 +08:00
|
|
|
{
|
|
|
|
CC_SAFE_RETAIN(obj);
|
|
|
|
CC_SAFE_RELEASE(_object);
|
|
|
|
_object = obj;
|
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
|
|
|
}
|