项目作者: R4M80MrX

项目描述 :
cocos creator 版的 countUp.js, 数字label缓动效果组件
高级语言: TypeScript
项目地址: git://github.com/R4M80MrX/cocos-creator-countUp.git
创建时间: 2020-03-28T05:22:33Z
项目社区:https://github.com/R4M80MrX/cocos-creator-countUp

开源协议:MIT License

下载


cocos-creator-countUp

cocos creator 版的 countUp.js, 数字 label 缓动效果组件
参数说明详见 countUp.js

inspector

  1. import CountUp from "../Libs/countUp/countUp";
  2. const { ccclass, property } = cc._decorator;
  3. @ccclass
  4. export default class NewClass extends cc.Component {
  5. @property(CountUp)
  6. labelCountUp: CountUp = null;
  7. pool: cc.NodePool;
  8. start() {
  9. this.labelCountUp.startAnim();
  10. const n = new cc.Node();
  11. const l = n.addComponent(cc.Label);
  12. l.string = "1";
  13. this.node.addChild(n);
  14. n.addComponent(CountUp)
  15. .setup(3000)
  16. .startAnim();
  17. window.setTimeout(() => {
  18. this.labelCountUp.cUpdate(1000);
  19. }, 4000);
  20. }
  21. }