Creating An In Game Clock

Started by Ace_Gamer, Wed 12/10/2005 15:17:13

Previous topic - Next topic

Ace_Gamer

is there any way to create a clock that appears in game that is in sync with the desktop clock on your computer? 

i want the clock to appear in 1 or two rooms only, NOT every room.

Ashen

#1
DateTime.Now:
Quote from: The Manual
Now property
(Formerly known as GetTime, which is now obsolete)

readonly static DateTime* DateTime.Now;

Gets the current system time. You could use this for timing a loop, or for effects like telling the player to go to bed, and so on.
A DateTime object is returned, which contains various properties that you can use.

Note that the DateTime object that you get will not be kept up to date with the current time; it will remain static with the time at which you called DateTime.Now.

Example:

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);

will display the current date and time in 24-hour format

As for only having it in one or 2 rooms, it depends on how you want it to be displayed. Just turning the relevant GUI on only in those rooms should work.

EDIT:
A search for DateTime, GetTime, or just clock should turn up some other options.
I know what you're thinking ... Don't think that.

Ace_Gamer

i want the clock to appear on a clock tower or tv or characters watch etc...

Ashen

As in, you want the clock face to show the time (like here, except newer functions make it even easier or here, if you prefer digital clocks) or just look at it, and it says "The time is ..." (as in the example code above)?

Again, try a forum search, and if you still can't find what you want, ask a more specific question.
I know what you're thinking ... Don't think that.

Gilbert

Well if you don't mind the clock to be drawn just on the background, you can try using Raw Draw functions.
:=

Ace_Gamer

the 'raw draw' file won't unzipp! something about an unknown compression method ???

Gilbert

What did you use to unzip it? works for me.

Ashen

Doesn't work for me either - using WinRar, and Explorer itself.
Can you re-upload?
I know what you're thinking ... Don't think that.

Candle

Try this one . I unzip it with winrar and rezip it.
http://www.mytempdir.com/205521

Gilbert


SMF spam blocked by CleanTalk