开发环境:Cocos2dx 3.17
开发语言:lua
我们在开发游戏的时候经常会用到扇形进度条。比如:技能CD
下面直接上代码吧
1 2 3 4 5 6 7 8 9
| function skillCD() local loading = cc.Sprite:create('skill.png') local progress = cc.ProgressTimer:create(loading) progress:setMidpoint(cc.p(0.5, 0.5)) progress:setType(cc.PROGRESS_TIMER_TYPE_RADIAL) progress:setReverseDirection(true) self:addChild(progress) progress:setPercentage(100) end
|