Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nommiin/Timers
An implementation of both setTimeout and setInterval from JS in GameMaker Studio 2.3
https://github.com/nommiin/Timers
Last synced: 2 months ago
JSON representation
An implementation of both setTimeout and setInterval from JS in GameMaker Studio 2.3
- Host: GitHub
- URL: https://github.com/nommiin/Timers
- Owner: nommiin
- License: mit
- Created: 2020-04-24T17:07:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T17:46:21.000Z (over 4 years ago)
- Last Synced: 2024-08-02T07:07:31.447Z (5 months ago)
- Language: Yacc
- Size: 16.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gamemaker - Timer - Timer methods based on setTimeout and setInterval from JS. (Utilities / Recommendations)
README
# Timers
An implementation of both setTimeout and setInterval from JS in GameMaker Studio 2.3# Usage
1. Copy `setTimeout`, `setInterval`, and `setManager` into your project
1. Create an instance of the `setManager` at game start (alternatively, call `__INTERVAL_UPDATE__` and `__TIMEOUT_UPDATE__` every frame)
2. Create an timeout or interval using `setTimeout`/`setInterval` respectively
3. Use `clearTimeout`/`clearInterval` to stop them from running# Extra
- Callback functions have an `arguments` variable which is an array of arguments that are passed to the callback from the inital `setTimeout`/`setInterval` functions
- `setTimeout`/`setInterval` return a numerical ID which can be passed into `clearTimeout`/`clearInterval` to stop them from running