Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: duanne_boy on Thu 14/03/2013 21:33:18

Title: time
Post by: duanne_boy on Thu 14/03/2013 21:33:18
is the away i can display current time and date on the screen?
Title: Re: time
Post by: Crimson Wizard on Thu 14/03/2013 21:42:45
Have you read the manual?

Check DateTime.Now (http://www.adventuregamestudio.co.uk/wiki/DateTime_functions_and_properties#DateTime.Now).
Example from the manual:
Code (ags) Select

DateTime *dt = DateTime.Now;
Display("The date is: %02d/%02d/%04d", dt.DayOfMonth, dt.Month, dt.Year);
Display("The time is: %02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second);
Title: Re: time
Post by: Khris on Thu 14/03/2013 21:43:33
The scripting part of the manual has a section titled "DateTime functions and properties".
You can use those and String.Format() to put text on a GUI's label in repeatedly_execute.