【发布时间】:2016-04-19 12:36:36
【问题描述】:
下面是一个用 LUA 编写的 Corona SDK 倒数计时器示例。 我将如何为此添加天、月和年?
local function updateTime()
-- decrement the number of seconds
secondsLeft = secondsLeft - 1
-- time is tracked in seconds. We need to convert it to minutes and seconds
local minutes = math.floor( secondsLeft / 60 )
local seconds = secondsLeft % 60
-- make it a string using string format.
local timeDisplay = string.format( "%02d:%02d", minutes, seconds )
clockText.text = timeDisplay
结束
【问题讨论】: