Time to text m:ss

About advanced scenes, and the Thyme scripting language used in Algodoo.

Time to text m:ss

Postby Kilinich » Sat Dec 15, 2012 2:04 pm

Might be useful:

Code: Select all
//Convert time into "m:ss"
scene.my.time2text := (t) => {
  s := math.toInt(t%60);
  math.toString(math.toInt(t/60)) + ":" + math.toString(s/10) + math.toString(s%10);
};
print("Algodoo running time: "+scene.my.time2text(system.time));
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron