Jump to content


Photo

time


  • Please log in to reply
2 replies to this topic

#1 Flygon12

Flygon12

    GMC Member

  • GMC Member
  • 103 posts
  • Version:Unknown

Posted 27 June 2012 - 10:57 AM

I´ve this:
Draw event:
draw_set_color(c_black);
 draw_text(view_xview[0]+view_wview[0]/20string_width(string(current_hour)+":"+string(curent_minute)+":"+string(current_second))/2,view_yview[0]+view_hview[0]string_height(string(current_hour)+":"+string(current_minute)+":"+string(current_second))1,string(current_hour)+":"+string(current_minute)+":"+string(current_second));

How to make the digital clock is up?

Room: 640*480
  • 0

#2 Noele

Noele

    GMC Mentor

  • GMC Member
  • 2347 posts
  • Version:GM8.1

Posted 27 June 2012 - 11:33 AM

Timestamps are handled differently however GM has some functions for this.

Create Event
start_time = date_current_time();

Draw Event
now = date_current_time()-start_time;
draw_text(x,y,date_datetime_string(now));
// shows something like hh:mm:ss

A timestamp is the time elapsed from a specific start date and time. The date portion is the integer whilst the time the remainder. Look up "date_" in the help index for all the date and time functions.
  • 1

#3 Flygon12

Flygon12

    GMC Member

  • GMC Member
  • 103 posts
  • Version:Unknown

Posted 27 June 2012 - 12:05 PM

EXCELLENT, Noele.
:laugh:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users