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);
  • 相关阅读:
    phone 接口实现
    linux 下查找文件或者内容常有命令【转】
    【转】线程问题引起的内存泄露
    Canvas的save和restore 之二
    getIdentifer()函数的用法
    canvas.clipRect
    blob
    Android中Context
    canvas中的save用法之一
    sharedPreferences
  • 原文地址:https://www.cnblogs.com/linn/p/3488067.html
Copyright © 2011-2022 走看看