12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // 数字变化动画
- //
- #ifndef RULbNumberIncrease_h
- #define RULbNumberIncrease_h
- #include "cocos2d.h"
- #include "RUDefine.h"
- using namespace std;
- USING_NS_CC;
- NS_RU_BEGIN
- //label数字动画
- class LbNumberIncrease : public ActionInterval
- {
- public:
- static LbNumberIncrease* create(const float duration, const int start_value, const int end_value);
-
- protected:
- virtual void startWithTarget(Node* target) override;
- virtual void update(float dt) override;
- virtual void stop() override;
-
- private:
- LbNumberIncrease() = default;
- ~LbNumberIncrease() = default;
-
- bool init(float duration, const int start_value, const int end_value);
-
- private:
- int _start_value = 0;
- int _end_value = 0;
- float _increase_value = 0.0f;
- int _curFrameIndex = 0;
- };
- NS_RU_END
- #endif /* RULbNumberIncrease_h */
|