Welcome, guest! Login / Register - Why register?
[email protected] webmail now available. Want one? Go here.

Paste

Pasted as JavaScript by Username ( 11 years ago )
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);

    }



});

 

Revise this Paste

Your Name: Code Language: