您的位置:首页 > 产品设计 > UI/UE

quick3x_游戏场景计时器

2015-06-12 11:27 447 查看
function BattleUi:sceneTimeUpdate(t)
if self.timePause == true then
return
end
self.startTime  = self.startTime  + 1 + self.extraValue    --<span style="font-family: Arial, Helvetica, sans-serif;">self.extraValue用来控制计时器增加时间还是减少时间,默认为0</span>

if self.startTime < 0  then
self.startTime = 0
end
local second = self.startTime % 60
local minutes = math.floor(self.startTime /60)
self.extraValue=0
if minutes<10 then
minutes = "0"..minutes
end
if second<10 then
second = "0"..second
end

local label = string.format("%2s:%2s",minutes,second)
self.timeLabel:setString(label)   <span style="white-space:pre">				</span>--在label中显示
end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: