Methods
-
create_timer(autoDestroy)
-
Creates and returns a new timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description autoDestroyBoolean whether or not the timer should automatically destroy when it's done
Code Equivalent:
game.time.create(autoDestroy) -
delta_time_milliseconds()
-
Returns the physics update delta in milliseconds.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.time.physicsElapsedMS -
delta_time_seconds()
-
Returns the physics update delta in seconds.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.time.physicsElapsed -
get_time_numeric_member(field)
-
Returns the chosen numeric field value of the game timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description fieldthe value to get
Code Equivalent:
game.time.field -
get_timer_boolean_member(field, timer)
-
Returns the chosen boolean field value of the timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description fieldthe value to get
timertimer to get the values from
Code Equivalent:
timer.field -
get_timer_numeric_member(field, timer)
-
Returns the chosen numeric field value of the timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description fieldthe value to get
timertimer to get the values from
Code Equivalent:
game.time.physicsElapsedMS -
set_time_numeric_member(field, value)
-
Assigns the chosen numeric field for the game timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description fieldthe value to set
valuevalue to set the field to
Code Equivalent:
game.time.field = value; -
set_timer_boolean_member(field, timer, value)
-
Assigns the chosen boolean field for the timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description fieldthe value to set
timertimer to assign values for
valuevalue to set the field to
Code Equivalent:
timer.field = value; -
set_timer_numeric_member(field, timer, value)
-
Assigns the chosen numeric field for the timer.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description fieldthe value to set
timertimer to assign values for
valuevalue to set the field to
Code Equivalent:
timer.field -
start_timer(delay, timer)
-
Start the chosen timer after the given amount of time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description delayNumber how long to wait before starting the timer
timertimer to start
Code Equivalent:
timer.start(delay); -
time_constants(constant)
-
Returns the chosen constant time value.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description constantwhich time value to return
Code Equivalent:
constant -
timer_add_event_complex(delay, callback, timer, arguments)
-
Adds an event to the timer, to be called after the given amount of time, once the timer has started running. The delay applies only after the timer has started.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description delayNumber the number of milliseconds before the timer function is called
callbackthe function to call
timertimer to add the function call event to
arguments(optional) arguments to use in the function that gets called
Code Equivalent:
timer.add(delay, callback, undefined, code); -
timer_destroy(timer)
-
Destroy the timer and stops any future related events from happening.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description timertimer to destroy
Code Equivalent:
timer.destroy(); -
timer_loop_event_complex(delay, callback, timer, arguments)
-
Adds an event to the timer, to be called continuously after the given amount of time, once the timer has started running. The delay applies only after the timer has started.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description delayNumber the number of milliseconds before the timer function is called
callbackthe function to call
timertimer to add the function call event to
arguments(optional) arguments to use in the function that gets called
Code Equivalent:
timer.loop(delay, callback, code); -
timer_loop_event_complex(delay, repeatCount, callback, timer, arguments)
-
Adds an event to the timer, to be called continuously after the given amount of time for the given number of times, once the timer has started running. The delay applies only after the timer has started.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description delayNumber the number of milliseconds before the timer function is called
repeatCountNumber the number of times to call the event
callbackthe function to call
timertimer to add the function call event to
arguments(optional) arguments to use in the function that gets called
Code Equivalent:
timer.loop(delay, callback, code); -
timer_pause(timer)
-
Pause the timer and all future related events.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description timertimer to pause
Code Equivalent:
timer.pause(); -
timer_resume(timer)
-
Resumes the timer and all future related events.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description timertimer to resume
Code Equivalent:
timer.resume(); -
timer_set_on_complete_callback(timer, callback)
-
Call the given function once the timer has completed and has no other events to call.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description timertimer to use
callbackfunction to call
Code Equivalent:
timer.onComplete.add(callback); -
timer_stop(timer, clearEvents)
-
Stops the timer, with the option to clear the related events.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description timertimer to stop
clearEventsBoolean option to keep or remove events related to the timer
Code Equivalent:
timer.stop(clearEvents);