// Wrapper for some canvas drawing functions var canvas = { get canvas() { return GameWindow.canvas; }, get context() { return GameWindow.canvasContext; }, drawText: function(text, x, y, size, font, color) { this.context.font = font? size + 'px ' + font : size + 'px Arial'; this.context.fillStyle = color; this.context.textAlign = "center"; this.context.textBaseline="middle"; this.context.fillText(text, x, y); } }