进度条

  local to2 = cc.ProgressTo:create(3, 100)  
        local to3  =cc.ProgressFromTo:create(3, 0, 100);

        local right = cc.ProgressTimer:create(cc.Sprite:create(BLACKJACK.greenBtn)) 
        -- 设置渲染类型  
          right:setType(cc.PROGRESS_TIMER_TYPE_BAR)  
          -- Setup for a bar starting from the left since the midpoint is 1 for the x  
          --  用来设定进度条横向前进的方向从左向右或是从右向左,这里是从右往左  
          right:setMidpoint(cc.p(0,1))  
          -- Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change  
          -- 用来设置进度条增长按横向或是按纵向增长,这里是横向增长  
          right:setBarChangeRate(cc.p(1, 0))  
          -- 设置渲染器到右边  
          right:setPosition(cc.p(500,540))  
          -- 让它运行一个无限循环的进度动画,进度变化由控制器2来控制  
        --   right:runAction(cc.RepeatForever:create(to3))  
          right:runAction(to3) 
        --   right:runAction(cc.RepeatForever:create(cc.Sequence:create(cc.TintTo:create(1, 255,0,0), cc.TintTo:create(1, 0,255,0), cc.TintTo:create(1, 0,0,255))))
          self.blackJackUI:addChild(right)
        -- self:createCircleLoadingBar(self.blackJackUI)

你可能感兴趣的:(进度条)