Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/Assets/Lua/MovieClock.lua
2 views
1
while true do
2
if (movie.isloaded()) then
3
fps = movie.getfps();
4
frames = movie.length();
5
tseconds = (frames / fps)
6
secondsraw = tseconds % 60;
7
shift = 10 ^ 2;
8
seconds = math.floor((secondsraw * shift) + 0.5) / shift;
9
secondsstr = string.format("%.2f", seconds)
10
if (seconds < 10) then
11
secondsstr = "0" .. secondsstr;
12
end
13
14
minutes = (math.floor(tseconds / 60)) % 60;
15
minutesstr = minutes;
16
if (minutes < 10) then
17
minutesstr = "0" .. minutesstr;
18
end
19
20
hours = (math.floor(tseconds / 60 / 60)) % 24;
21
22
time = minutesstr .. ":" .. secondsstr;
23
if (hours > 0) then
24
time = "0" .. hours .. ":" .. time;
25
end
26
gui.text(0, 0, time, null, null, 1);
27
end
28
emu.frameadvance();
29
end
30