RULbNumberIncrease.h 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // 数字变化动画
  3. //
  4. #ifndef RULbNumberIncrease_h
  5. #define RULbNumberIncrease_h
  6. #include "cocos2d.h"
  7. #include "RUDefine.h"
  8. using namespace std;
  9. USING_NS_CC;
  10. NS_RU_BEGIN
  11. //label数字动画
  12. class LbNumberIncrease : public ActionInterval
  13. {
  14. public:
  15. static LbNumberIncrease* create(const float duration, const int start_value, const int end_value);
  16. protected:
  17. virtual void startWithTarget(Node* target) override;
  18. virtual void update(float dt) override;
  19. virtual void stop() override;
  20. private:
  21. LbNumberIncrease() = default;
  22. ~LbNumberIncrease() = default;
  23. bool init(float duration, const int start_value, const int end_value);
  24. private:
  25. int _start_value = 0;
  26. int _end_value = 0;
  27. float _increase_value = 0.0f;
  28. int _curFrameIndex = 0;
  29. };
  30. NS_RU_END
  31. #endif /* RULbNumberIncrease_h */