function Screen(canvas, resolution) {
    "use strict";

    if (!(canvas instanceof HTMLCanvasElement)) {
        throw new InvalidArgumentError("canvas", "Invalid canvas object passed: " + canvas);
    }

    this.size = new Vector2(canvas.width, canvas.height);
    this.font = "HelveticaNeue Liberation Roboto Sans";
    this.fontColor = "#FFF";
    this.fontSize = 20;

    if (!(resolution instanceof Vector2)) {
        this.resolution = this.size;
    } else {
        this.resolution = resolution;
    }

    var context = canvas.getContext("2d");

    Log.info("Screen initialized. Canvas Size: " + this.size + " Resolution: " + this.resolution, this);

    this.render = function (image, position, size) {
        context.drawImage(image, position.x, position.y, size.x, size.y);
    };

    this.clear = function () {
        context.clearRect(0, 0, this.size.x, this.size.y);
    };

    this.renderText = function (text, position, size, colour, font) {
        if (typeof font === 'undefined') {
            font = this.font;
        } else if (typeof font !== 'string') {
            throw new InvalidArgumentError("font", "Fonts have to be strings containing both the font size and one or more font families. Received: " + font);
        }

        if (typeof size === 'undefined') {
            size = this.fontSize;
        } else if (typeof size !== 'number') {
            throw new InvalidArgumentError("size", "size must be an integer. Received: " + size);
        }

        if (typeof colour === 'undefined') {
            colour = this.fontColor;
        } else if (typeof colour !== 'string') {
            throw new InvalidArgumentError("colour", "Colours have to be strings. Received: " + colour);
        }

        if (typeof position === 'undefined') {
            position = new Vector2();
        } else if (!(position instanceof Vector2)) {
            throw new InvalidArgumentError("position", "Position should be a Vector2. Received: " + position);
        }

        context.font = size + "px " + font;
        context.fillStyle = colour;
        context.fillText(text, position.x, position.y);
    };

    this.addEventListener = function (event, callback) {
        canvas.addEventListener(event, callback);
    };

    this.setOnContextMenu = function (callback) {
        canvas.oncontextmenu = callback;
    };
}

Screen.prototype.toString = function () {
    "use strict";
    return "Screen";
};
@@ -881,32 +881,36 @@
 size.y);%0A    %7D;%0A
+    
 %0A    this.render
@@ -909,19 +909,25 @@
 s.render
-Tex
+FilledRec
 t = func
@@ -934,14 +934,106 @@
 tion
- (text
+(position, size, colour) %7B%0A        context.fillStyle = colour;%0A        context.fillRect(position.x
 , po
@@ -1038,30 +1038,92 @@
 position
+.y
 , size
-, colour
+.x, size.y);%0A    %7D;%0A    %0A    this.getTextWidth = function(text, size
 , font) 
@@ -1637,32 +1637,1064 @@
 size);%0A        %7D
+%0A        %0A        context.font = size + %22px %22 + font;%0A        return context.measureText(text).width;%0A    %7D%0A    %0A    this.getTextHeight = function(text, size, font) %7B%0A        if (typeof size === 'undefined') %7B%0A            size = this.fontSize;%0A        %7D else if (typeof size !== 'number') %7B%0A            throw new InvalidArgumentError(%22size%22, %22size must be an integer. Received: %22 + size);%0A        %7D%0A        %0A        return size;%0A    %7D%0A%0A    this.renderText = function (text, position, size, colour, font, width) %7B%0A        if (typeof font === 'undefined') %7B%0A            font = this.font;%0A        %7D else if (typeof font !== 'string') %7B%0A            throw new InvalidArgumentError(%22font%22, %22Fonts have to be strings containing both the font size and one or more font families. Received: %22 + font);%0A        %7D%0A%0A        if (typeof size === 'undefined') %7B%0A            size = this.fontSize;%0A        %7D else if (typeof size !== 'number') %7B%0A            throw new InvalidArgumentError(%22size%22, %22size must be a number. Received: %22 + size);%0A        %7D
 %0A%0A        if (ty
@@ -3176,32 +3176,299 @@
 tion);%0A        %7D
+%0A        %0A        if (typeof width === 'undefined') %7B%0A            width = this.getTextWidth(text, size, font);%0A        %7D else if (typeof width !== 'number') %7B%0A            throw new InvalidArgumentError(%22width%22, %22width must be a number. Received: %22 + width);%0A        %7D
 %0A%0A        contex
@@ -3525,32 +3525,32 @@
 Style = colour;%0A
-
         context.
@@ -3586,16 +3586,23 @@
 sition.y
+, width
 );%0A    %7D

Add methods to calculate text dimensions