Skip to content

Instantly share code, notes, and snippets.

View wwqrd's full-sized avatar

Stephen wwqrd

  • United Kingdom
  • 04:02 (UTC +01:00)
View GitHub Profile
@wwqrd
wwqrd / stats.js
Created July 31, 2012 21:17
A simple stats display
(function() {
var Stats = function() {
var d = document.createElement("div");
d.setAttribute("style","color:#fff;font-size:10px;position:absolute;top:2px;left:2px;width:80;height:30px;padding:5px;z-index:1000;background:rgba(0,0,0,0.85);");
document.getElementsByTagName("body")[0].appendChild(d);
this.d = d;
this.stats = {};
this.measurements = {};
};
@wwqrd
wwqrd / hud.js
Created May 3, 2012 17:41
Simple debug hud
var hud = function(msg, length) {
var length = length || 2;
window.hudBuffer = window.hudBuffer || [];
window.hudBuffer.push(msg);
if(window.hudBuffer.length > length) {
window.hudBuffer.shift();
}
hudString = "";