Last active
September 6, 2018 12:23
-
-
Save PixelsCommander/f9ce6d5b8ca91d640d9d0cdc8d03dff5 to your computer and use it in GitHub Desktop.
FPS meter for RNG games, pug to GameBase.assetsLoaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FPSMeter = document.createElement("div"); | |
FPSMeter.id = "fpsLabel"; | |
FPSMeter.style.fontSize = "24px"; | |
FPSMeter.style.position = "absolute"; | |
FPSMeter.style.right = "0"; | |
FPSMeter.style.top = "0"; | |
FPSMeter.style.backgroundColor = "#000"; | |
FPSMeter.style.color = "#fff"; | |
FPSMeter.style.zIndex = "99999"; | |
document.body.appendChild(FPSMeter); | |
setInterval(() => { | |
FPSMeter.innerHTML = "" + this.getEngine().getFps(); | |
}, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment