time function

Posted By: Erick_Castro

time function - 12/02/09 18:07

i need a function that shows on the screen the advance of seconds and minutes.

Does somebody has it?

thanks, friends.
Posted By: Liamissimo

Re: time function - 12/02/09 18:30

You mean something that sows the time? Example:
Code:
var seconds;
function timeeverysecond()
{
  while(1)
  {
    seconds += 1;
    wait(-1);
  }
}



And then a Panel with the digits code:
Code:
digits(pos_x,pos_y,0,*,10,seconds);


Posted By: Lukas

Re: time function - 12/02/09 19:14

For minutes and seconds, better take this code:
Code:
var seconds_passed = 0;
var seconds, minutes;
function timeeverysecond()
{
  while(1)
  {
    seconds_passed += 1;
    
    seconds = seconds_passed % 60;
    minutes = integer(seconds_passed/60);
    wait(-1);
  }
}


Posted By: Erick_Castro

Re: time function - 12/02/09 19:23

thank you, friend.
Posted By: Erick_Castro

Re: time function - 12/03/09 06:59

thanks, Lucas.
© 2024 lite-C Forums