Oldest known version of this page was edited on 2007-03-18 17:05:39 by MiKail []
Page view:
updateTimer()
Description
Adds a timer to the top-left portion of the screen showing the amount of time that has elapsed since the start of the game.
Example
Rule_AddInterval("updateTimer", 1)
Arguments
Definition
function updateTimer()
dr_clear("timer")
dr_setautoclear("timer",0)
local time = Universe_GameTime();
local h = floor(time/3600.0);
local m = floor(time/60.0 - h*60);
local s = time - m*60 - h*3600;
local str = format("Time: %2.0fh %2.0fm %3.1fs",h, m, s)
dr_text2d("timer",0.0,0.98,str, 255,255,255)
end