https://github.com/davidfig/debug
Javascript Debug Panels (useful for game development)
https://github.com/davidfig/debug
Last synced: about 1 month ago
JSON representation
Javascript Debug Panels (useful for game development)
- Host: GitHub
- URL: https://github.com/davidfig/debug
- Owner: davidfig
- License: mit
- Created: 2016-07-03T00:44:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-29T00:19:39.000Z (almost 8 years ago)
- Last Synced: 2024-10-16T09:14:51.805Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.78 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.hbs
- License: LICENSE
Awesome Lists containing this project
README
## debug.js
debug panels for javascript (designed for game development)## Code Example
const Debug = require('@yy/debug');
// initialize the library
Debug.init();// send a message to the default panel created in the init()
Debug.log('This is a test message.');// add an FPS panel and meter
var fps = Debug.add('FPS', {text: '0 FPS', side: 'rightBottom'});
var meter = Debug.addMeter('panel', {side: 'rightBottom'});// update the FPS
setInterval(function () {
var FPS = Math.random() * 60;// adds a meter line
Debug.meter(Math.random() * 2 - 1, {panel: meter});// replaces all HTML in FPS panel
Debug.one(Math.round(FPS) + ' FPS', {panel: fps, color: (FPS < 30 ? 'red' : null)});
}, 60);Debug.add('testing', {text: 'this is another panel.'});
## Live Example
https://davidfig.github.io/debug/see also
* https://davidfig.github.io/update/
* https://davidfig.github.io/animate/
* https://davidfig.github.io/renderer/
* https://davidfig.github.io/viewport/## Installation
include debug.js in your project or add to your workflownpm install yy-debug
# API Reference
{{>main}}* * *
Copyright (c) 2016 YOPEY YOPEY LLC - MIT License - Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown)