var Engine = Class.extend({
canvas_id: 'canvas',
canvas: '',
context: '',
init: function(canvas_id)
{
console.log('init: Setting this.canvas_id to ' + canvas_id);
this.canvas_id = canvas_id;
},
begin: function()
{
console.log('begin: Getting element with ID ' + this.canvas_id);
this.canvas = document.getElementById(this.canvas_id);
console.log(this.canvas_id);
console.log('begin: Set this.canvas', this.canvas)
this.context = this.canvas.getContext('2d');
this.context.fillText("Hello World!", 10, 10);
}
});
Add a code snippet to your website: www.paste.org