-
... initGrid { arg w, argbounds, argcolumns, argrows, argborder=false; var p, rect, pen; lazyRefreshFunc = { this.refresh; refreshDeferred = false; }; bounds = argbounds ? Rect(20, 20, 400, 200); bounds = Rect(bounds.left , bounds.top , bounds. ...
-
... s-1) or: { x > (numColumns-1) }){ ^false }; ^true } // draws the Matrix using a Pen // the result can be moved to another position by providing the parameters xOffset and yOffset draw { |xOffset=0, yOffset=0| array.do { |row, ri| row.do { | ...
-
... toggleRect = this.pr_calcToggleRect(orientation); rad = this.pr_calcRadius() ; Pen.use { // horizontal labelOffset=5; Pen.font = font; Pen.color_(labelColor); label.notNil.if{ this.drawLabel(orientation); }; label2.notNil.if{ this.drawLabe ...
-
//many pendulums in a world with gravity ( var width= 300, height= 300, w, wgrav, world, n= 50, ploc; //--world w= RedWindow("pendulum test2", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld3(RedVector2D[wi ...
-
//many pendulums in a world with gravity ( var width= 300, height= 300, w, wgrav, world, n= 50, ploc; //--world w= RedWindow("pendulum test2", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld3(RedVector2D[wi ...
-
... 0.001))*0.5+0.5*width, cos(w.frame*0.027+cos(w.frame*0.0012))*0.5+0.5*height ]; Pen.strokeColor= Color.yellow; Pen.strokeOval(Rect.aboutRedObject2D(rep)); Pen.strokeColor= Color.white; world.objects.do{|o, i| if(o!=rep, { o.addForce(o.gravi ...
-
... 0.001))*0.5+0.5*width, cos(w.frame*0.027+cos(w.frame*0.0012))*0.5+0.5*height ]; Pen.strokeColor= Color.yellow; Pen.strokeOval(Rect.aboutRedObject2D(rep)); Pen.strokeColor= Color.white; world.objects.do{|o, i| if(o!=rep, { o.addForce(o.gravi ...
-
... nt( super.bounds.width / 2, super.interactionRect.bottom - symbolPosition ); }; Pen.strokeColor_(super.mainColor); Pen.width_(super.outlineSize); if(thisDisplayLine != \none) { if(thisDisplayLine == \full) { if(super.orientation == \horizon ...
-
... el, 0, mass, mass*10); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.fillColor= Color.grey(0, cnt.fold(0, 500)/10000); Pen.fillRect(Rect(0, 0, width, height)); world.objects.do{|o| world.objects.do{|oo| var dist= o.loc.distan ...
-
... el, 0, mass, mass*10); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.fillColor= Color.grey(0, cnt.fold(0, 500)/10000); Pen.fillRect(Rect(0, 0, width, height)); world.objects.do{|o| world.objects.do{|oo| var dist= o.loc.distan ...