An open API service indexing awesome lists of open source software.

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)

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 workflow

npm 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)