123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef __RED_KEYFRAME_H__
- #define __RED_KEYFRAME_H__
- #include "base/CCRef.h"
- #include "base/CCValue.h"
- #include "math/Vec2.h"
- namespace redream {
- class CC_DLL REDKeyframe : public cocos2d::Ref
- {
- public:
- enum class EasingType
- {
- INSTANT,
-
- LINEAR,
-
- CUBIC_IN,
- CUBIC_OUT,
- CUBIC_INOUT,
-
- ELASTIC_IN,
- ELASTIC_OUT,
- ELASTIC_INOUT,
-
- BOUNCE_IN,
- BOUNCE_OUT,
- BOUNCE_INOUT,
-
- BACK_IN,
- BACK_OUT,
- BACK_INOUT,
-
- //新加的类型正弦变化【0,PI/2】
- SineIn,
- SineOut,
- SineInOut,
-
-
- ExponentialIn,
- ExponentialOut,
- ExponentialInOut,
-
- CircleActionIn,
- CircleActionOut,
- CircleActionInOut,
-
- //2次
- QuadraticActionIn,
- QuadraticActionOut,
- QuadraticActionInOut,
-
- //3次
- CubicActionIn,
- CubicActionOut,
- CubicActionInOut,
-
- //4次
- QuarticActionIn,
- QuarticActionOut,
- QuarticActionInOut,
-
- //5次
- QuinticActionIn,
- QuinticActionOut,
- QuinticActionInOut,
-
- Custom,//自定义曲线
- };
- /**
- * @js ctor
- */
- REDKeyframe();
- /**
- * @js NA
- * @lua NA
- */
- ~REDKeyframe();
-
- const cocos2d::Value& getValue() const;
- void setValue(const cocos2d::Value& value);
-
- cocos2d::Ref* getObject() const;
- void setObject(cocos2d::Ref* obj);
-
- float getTime();
- void setTime(float fTime);
-
- EasingType getEasingType();
- void setEasingType(EasingType easingType);
-
- float* getEasingOpt();
- void setEasingOpt(float *fEasingOpt);
-
- std::vector<cocos2d::Vec2> getEqualPoints();
- void setEqualPoints(std::vector<cocos2d::Vec2> equalPoints);
-
- private:
- cocos2d::Value _value;
- cocos2d::Ref* _object;
- float _time;
- EasingType _easingType;
- float *_easingOpt;
-
- std::vector<cocos2d::Vec2> _equalPoints = {};
- };
- }
- #endif // __RED_KEYFRAME_H__
|