function Button(text, action, pos, width, height) {
	this.text = text;
	this.action = action;
	this.pos = pos;
	this.width = width;
	this.height = height;
}

Button.prototype.render = function(g) {
	g.strokeStyle = 'black';
	g.lineWidth = 2;
	g.beginPath();
	g.strokeRect(this.pos.x, this.pos.y, this.width, this.height);
	g.font = "11px sans-serif";
	g.textBaseline = "middle";
	g.textAlign = "center";
	g.fillStyle = 'black';
	g.beginPath();
	g.fillText(this.text, this.pos.x + this.width / 2, this.pos.y + this.height / 2);
}

Button.prototype.contains = function(p) {
	var xDist = p.x - this.pos.x;
	var yDist = p.y - this.pos.y;
	if (xDist > 0 && xDist < this.width && yDist > 0 && yDist < this.height) return true;
	return false;
}

