您的位置:首页 > 其它

Creator 设置圆形进度条

2016-09-14 10:51 176 查看
如图设置图片的Type 为FILLED ,FillType 为RADIAL ,FillCenter(图片扇形中心)为cc.p(0.5,0.5) ,FillStart(开始部分)为0.25(最高点开始)

注:yuanxing为拖进去的图片节点

//圆形滚动条

    _yuangundontiao:function(){

        this.yuanxing.getComponent(cc.Sprite).fillRange = 1

        this._jindutiaotime(100)

    },

    _jindutiaotime:function(time){

        var self = this

        if(time > 0){

            this.scheduleOnce(function() {

                cc.log(time)

                self.yuanxing.getComponent(cc.Sprite).fillRange = time/100

                self._jindutiaotime(--time)

            }, 0.1);

        }

        else {

            this.yuanxing.getComponent(cc.Sprite).fillRange = time/30

            cc.log("时间到")

        }

    },
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: