Skip to content

Instantly share code, notes, and snippets.

@RudolfVonKrugstein
Created July 16, 2012 12:46
Show Gist options
  • Save RudolfVonKrugstein/3122496 to your computer and use it in GitHub Desktop.
Save RudolfVonKrugstein/3122496 to your computer and use it in GitHub Desktop.
haste drawing javascript
function jsGetContext2d(canvas, _) {
return [1,0,canvas.getContext("2d")];
}
function jsFillRect(context, x, y, width, height, _) {
context.fillRect(x,y,width,height);
return [1,0];
}
function jsSetFillColor(context, color, _) {
context.setFillColor(color);
return [1,0];
}
function jsClear(context, _) {
context.clearRect(0.0, 0.0, context.canvas.width, context.canvas.height);
        return [1,0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment