# HG changeset patch # User wycc # Date 1282753692 -28800 # Node ID 9f4a1134ec825e3e2e6aebcf3dcbd4d002a3e640 # Parent 199bac90b90a96cb7f88747692746541d5bca92a Use the coord.remove() to implement the processing canvas diff -r 199bac90b90a -r 9f4a1134ec82 nodejs/canvas.js --- a/nodejs/canvas.js Thu Aug 26 00:16:12 2010 +0800 +++ b/nodejs/canvas.js Thu Aug 26 00:28:12 2010 +0800 @@ -4,6 +4,7 @@ function canvas(app,root) { this.mb_rt = app.mb_rt; + this.parent = root; this.root = this.mb_rt.coord_new(root); this.bg_r = 0; this.bg_g = 0; @@ -53,5 +54,54 @@ this.stroke_w = w; } +canvas.prototype.alpha=function(c) { +} + +canvas.prototype.red=function(c) { +} +canvas.prototype.green=function(c) { +} +canvas.prototype.blue=function(c) { +} + + +canvas.prototype.clear=function() { + this.root.remove(); + this.root = this.mb_rt.coord_new(this.parent); +} + +canvas.prototype.arc=function(x,y,w,h,start,end) { +} + +canvas.prototype.ellipse=function(x, y, width, height) { +} + +canvas.prototype.point=function(x,y) { +} + +canvas.prototype.quad=function(x1,y1,x2,y2,x3,y3,x4,y4) { +} + +canvas.prototype.triangle=function(x1,y1,x2,y2,x3,y3) { +} + +canvas.prototype.bezier=function(x1, y1, cx1, cy1, cx2, cy2, x2, y2) { +} + +canvas.prototype.curveTightness=function(squishy) { +} + +canvas.prototype.colorMode=function() { +} + +canvas.prototype.fill=function(color) { +} + +canvas.prototype.noFill=function() { +} + +canvas.prototype.noStroke=function() { +} + exports.canvas = canvas; diff -r 199bac90b90a -r 9f4a1134ec82 nodejs/testcanvas.js --- a/nodejs/testcanvas.js Thu Aug 26 00:16:12 2010 +0800 +++ b/nodejs/testcanvas.js Thu Aug 26 00:28:12 2010 +0800 @@ -11,14 +11,19 @@ app.canvas.strokeWeight(8); width=200; height=200; -for(i=0;i