dowsher escribió:Hola Cael!!
Te pido disculpas por no responder antes.
Checa este APZ que acabo de hacer y si tienes dudas pregunta.
kantigo escribió:hoping that after 59 it will return to 00
so in this example: 00:00:59 >>> 00:01:00
--[[ ===== ESTE CÓDIGO EN ON SHOW, ON PRELOAD O EN EL LUGAR DONDE SE QUIERA PONER EN ACCIÓN EL CRONOMETRO ===== ]]--
-- Establecemos las variables del cronometro en creo para comenzar a trabajar
Segundos = 0
Minutos = 0
Horas = 0
-- Iniciamos en proceso Timer de la página
Page.StartTimer(1000, 24) -- 1000 equivale a un segundo
--[[ ===== ESTE CÓDIGO EN ON TIMER ===== ]]--
if e_ID == 24 then
-- Sumar un segundo al cronometro
Segundos = Segundos + 1
if Segundos == 60 then
Segundos = 0
Minutos = Minutos + 1
if Minutos == 60 then
Minutos = 0
Horas = Horas + 1
end
end
-- Colocar el otro cero para el formato 00:00:00
if #(tostring(Segundos)) == 1 then Segundos = "0"..Segundos end
if #(tostring(Minutos)) == 1 then Minutos = "0"..Minutos end
if #(tostring(Horas)) == 1 then Horas = "0"..Horas end
-- Concatenar para hcer un solo string
local Tiempo = Horas..":"..Minutos..":"..Segundos
-- Mostrar al usuario por medio de un Paragraph
Paragraph.SetText("Paragraph5", Tiempo)
end