Skip to content

Instantly share code, notes, and snippets.

@moebio
Created June 22, 2012 15:16
Show Gist options
  • Save moebio/2973392 to your computer and use it in GitHub Desktop.
Save moebio/2973392 to your computer and use it in GitHub Desktop.
just another inlet to tributary
var xT = 20;
var yT = 20;
var W = 500;
var H = 500;
var backgroundColor = 'rgb(200,200,200)';
tributary.init = function(ctx) {
};
tributary.run = function(ctx,t) {
tributary.clear(); //helper function to clear the canvas
ctx.fillstyle = backgroundColor;
this.drawRect(ctx, 0, 0, 1, 1);
};
//graphic methods
tributary.drawRect = function(ctx, x, y, w, h){
ctx.fillRect(x*W+xT, y*H+yT, w*W, h*H);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment