zoukankan      html  css  js  c++  java
  • 带冷却时间的按钮(一)

    // 技能CD
                var progressBox2 = cc.Sprite.createWithSpriteFrameName("ui_progress3.png");
                progressBox2.setAnchorPoint(AnchorPointBottom);
                var progress2_xPos = winSize.width - 20;
                var progress2_yPos = winSize.height/2;
                progressBox2.setPosition(progress2_xPos, progress2_yPos);
                this.addChild(progressBox2, g_GameZOder.ui);
                this.lbProgress2 = cc.Sprite.createWithSpriteFrameName("ui_progress4.png");
                this.lbProgress2.setAnchorPoint(AnchorPointBottom);
                this.lbProgress2.setPosition(progress2_xPos, progress2_yPos);
                this.addChild(this.lbProgress2, g_GameZOder.ui);
    if (this._cd < this._ship.skillCd) {
                    this._cd ++;
                    if (this._cd == this._ship.skillCd) {
                // 播放CD结束动画

    // this.skill_up.runAction(cc.TintBy.create(0.1,0,-255,-255).reverse());
    var animation = cc.AnimationCache.getInstance().getAnimation(this._ship.skillIcon);
    animation.setRestoreOriginalFrame(true);
    var animate = cc.Animate.create(animation);
    var animate2 = animate.reverse();
    this.skill_up.runAction(cc.Sequence.create(animate, animate2));

    
                    }
                }
                else {
                    this._cd = this._ship.skillCd;
                }
                this.lbProgress2.setScaleY(this._cd / this._ship.skillCd);
  • 相关阅读:
    Python3开发环境及基本语法(一)
    PostMan接口测试工具
    Jmeter接口测试(三)
    Jmeter接口测试(二)
    Jmeter接口测试(一)
    Fiddler抓包工具
    HTTP协议数据结构分析
    CentOS7种搭建FTP服务器
    CentOS7 apache创建虚拟路径
    CentOS7上搭建WordPress博客
  • 原文地址:https://www.cnblogs.com/linn/p/3488067.html
Copyright © 2011-2022 走看看