-
... olors.add(Color.red(rrand(0.0, 1), rrand(0.4, 0.8))) }; makeLine = { arg index; Pen.color = Color.black; Pen.fillOval(Rect(currentForLine.x - 1, currentForLine.y + 3, width: 2, height: 8 )); Pen.stringAtPoint( index.asString, currentForLine ...
-
... {|x| x.notNil}; }.flat; syns= {Synth(\imp)}.dup(n); //--loop w.draw{ //--render Pen.smoothing= true; Pen.strokeColor= Color.white; sprs.do{|spr| spr.update; //--render springs Pen.moveTo(spr.object.loc.asPoint); Pen.quadCurveTo(spr.target.l ...
-
... lider setup v_slider.background_( Color.black ); v_slider.drawFunc_( { | view | Pen.width = 1; if (margin.notNil, { (view.bounds.width - (margin * 2)).do( { |index| Pen.strokeColor_( this.hsvToColor( [ index.linlin( 0, (view.bounds.width - ...
-
... ; } drawFocusRing { |rect, radius| if( this.hasFocus ) { if( GUI.id === \qt ) { Pen.use({ Pen.width = 1.5; Pen.color = Color.white.alpha_(0.75); Pen.roundedRect( rect.insetBy(1,1), radius-1 ).stroke; Pen.color = focusColor ?? { Color.blue.h ...
-
... | bounds = theWindow.bounds; //userView.bounds = bounds.copy.top_(0).left_(0); Pen.color = Color.black; nWhiteKeys.do( { |i| var position, keyWidth; keyWidth = bounds.width / nWhiteKeys; position = keyWidth * i; if( activeKeys.includes( i ...
-
... eight, width; height = this.bounds.height; width = this.bounds.width.asInteger; Pen.moveTo( 0 @ history[pos].linlin(0,1,height,0) ); (history.size).do({ |item, i| Pen.lineTo( (i+1) @ history.wrapAt(pos+i).linlin(0,1,height,0) ); }); Pen.lin ...
-
... or); if(thisFillShape) { this.prFillShape; }; // Draw beat if(thisBeat != -1) { Pen.fillColor_(super.beatColor); if(super.orientation == \horizontal) { Pen.fillRect( Rect( super.interactionRect.left + (thisBeat * (super.interactionRect.widt ...
-
... mouse input trg.loc= w.mouse; }); sprs.do{|spr| spr.update; //--render springs Pen.strokeColor= Color.grey; Pen.line(spr.object.loc.asPoint, spr.target.loc.asPoint); Pen.stroke; }; objs.do{|obj| obj.addForce(world.gravity); obj.update; wor ...
-
... |o, i| var index= kmeans.classifications[i]; var cent= kmeans.centroids[index]; Pen.strokeColor= colors[index]; Pen.line(o.loc.asPoint, cent.asPoint); Pen.stroke; Pen.strokeColor= Color.white; Pen.strokeRect(Rect.aboutRedVector2D(o.loc, o.s ...
-
//simple pendulum in a world with gravity ( var width= 300, height= 100, w, wgrav, world, n= 1, ploc; //--world w= RedWindow("pendulum test 1d", Rect(128, 64, width, height)).front; wgrav= RedVector[0.5]; world= RedWorld(RedVector[width], w ...