Timers
Functions
Create Timer
Create and return a new Timer. The timer will not be started, and will have an initial āticksā of 0.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer for resource tracking |
Return Type - Timer
Signatures
Free All Timers
Free all of timers that have been created.
Signatures
Free Timer
Free the memory used to store this timer.
Parameters
Name | Type | Description |
---|---|---|
to_free | Timer | The time to be released. |
Signatures
Has Timer
Checks if SplashKit has a timer with the indicated name.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Return Type - Boolean
Signatures
Pause Timer
Pause Timer
Pause the timer, getting ticks from a paused timer will continue to return the same time.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Signatures
Pause Timer
Pause the timer, getting ticks from a paused timer will continue to return the same time.
Parameters
Name | Type | Description |
---|---|---|
to_pause | Timer | The timer |
Signatures
Reset Timer
Reset Timer
Resets the named timer
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Signatures
Reset Timer
Resets the time of a given timer
Parameters
Name | Type | Description |
---|---|---|
tmr | Timer | The timer |
Signatures
Resume Timer
Resume Timer
Resumes the named timer.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Signatures
Resume Timer
Resumes a paused timer.
Parameters
Name | Type | Description |
---|---|---|
to_resume | Timer | The timer |
Signatures
Start Timer
Start Timer
Start a timer. The timer will then start recording the time that has passed.
You can check how long has past since the timer was started using the
Timer Ticks
function.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Signatures
Start Timer
Start a timer. The timer will then start recording the time that has passed.
You can check how long has past since the timer was started using the
Timer Ticks
function.
Parameters
Name | Type | Description |
---|---|---|
to_start | Timer | The timer |
Signatures
Stop Timer
Stop Timer
Stop the timer. The time is reset to 0 and you must recall start to begin the timer ticking again.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Signatures
Stop Timer
Stop the timer. The time is reset to 0 and you must recall start to begin the timer ticking again.
Parameters
Name | Type | Description |
---|---|---|
to_stop | Timer | The timer |
Signatures
Timer Named
Get the timer created with the indicated name.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer to fetch |
Return Type - Timer
Signatures
Timer Paused
Timer Paused
Indicates if the timer is paused.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Return Type - Boolean
Signatures
Timer Paused
Indicates if the timer is paused.
Parameters
Name | Type | Description |
---|---|---|
to_get | Timer | The timer |
Return Type - Boolean
Signatures
Timer Started
Timer Started
Indicates if the timer is started.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the timer |
Return Type - Boolean
Signatures
Timer Started
Indicates if the timer is started.
Parameters
Name | Type | Description |
---|---|---|
to_get | Timer | The timer |
Return Type - Boolean
Signatures
Timer Ticks
Timer Ticks
Gets the number of ticks (milliseconds) that have passed since the timer was started/reset. When paused the timerās ticks will not advance until the timer is once again resumed.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the Timer |
Return Type - undefined
Signatures
Timer Ticks
Gets the number of ticks (milliseconds) that have passed since the timer was started/reset. When paused the timerās ticks will not advance until the timer is once again resumed.
Parameters
Name | Type | Description |
---|---|---|
to_get | Timer | The timer |
Return Type - undefined
Signatures
Types
Timer
Timers in SplashKit can be used to track the passing of time. In general you will create a timer, start it, then use it to track time by asking for the timerās ticks (milliseconds).
Timers in SplashKit can be used to track the passing of time. In general you will create a timer, start it, then use it to track time by asking for the timerās ticks (milliseconds).