1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 19:42:01 +02:00

Add Canvas Render.

This commit is contained in:
Gunther Brunner 2014-02-19 23:55:08 +09:00
parent 168590a1b7
commit aa28801e87
4 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,16 @@
function CanvasRender(options, canvasElement) {
this.options = options
this.context = canvasElement.getContext('2d')
}
CanvasRender.prototype.draw = function (image) {
this.context.drawImage(image, 0, 0)
}
CanvasRender.prototype.clear = function () {
var width = 300
var height = 300
ctx.clearRect(0, 0, width, height)
}
module.exports = CanvasRender