-
... { o.addForce(o.gravityForce(oo)); }); }; o.update; world.contain(o); //--render Pen.strokeColor= Color.blue; Pen.strokeOval(Rect.aboutRedObject2D(o)); }; world.objects.do{|o, i| bary= bary+(o.loc*o.mass); }; bary= bary/totalMass; Pen.fillCo ...
-
... el= obj.vel*0; //stop object }); }); obj.update; world.contain(obj); //--render Pen.fillColor= Color.green; Pen.fillRect(fric); Pen.strokeColor= Color.white; Pen.strokeRect(Rect.aboutRedObject2D(obj)); }; w.play; CmdPeriod.doOnce({w.close}) ...
-
... route them to its ScaledUserView. w = ScaledUserViewWindow ( ); w.drawFunc = { Pen .width = 0.05 ; Pen .line( 0.1 @ 0.1 , 0.9 @ 0.9 ).stroke; }; // now move the sliders and see what happens w.gridLines = [ 10 , 4 ]; ( // grab and move poin ...
-
... ranslate( 20, 10 ) scale( 1.5 ) rotate( 45, 0, 0 )" this would convert into GUI.pen functions as follows: SVGTransform ( "translate( 20, 10 ) scale( 1.5 ) rotate( 45, 0, 0 )" ).asGUICode; /* result: GUI.pen.translate( 20, 10 ); GUI.pen.scal ...
-
... e }.dup(n); synths= {Synth("fm3Dtest", [\amp, 0.5/n])}.dup(n); //--loop w.draw{ Pen.strokeColor= Color.grey(0.5); Pen.strokeRect(Rect.aboutRedVector3D(RedVector[width/2, height/2, depth], width/2, width, height, depth, ss, ff)); Pen.strokeC ...
-
... SGUI.report(win); SGUI.adapt(win); backgroundImage= Image(200, 200).draw({|img| Pen.fillColor= palette.highlight.complementary; Pen.translate(img.width*0.5, img.height*0.5); 500.do{Pen.addRect(Rect(20.gauss(20), 20.gauss(20), 1, 1))}; Pen.f ...
-
... ontSize ? 36) }; u.background_(ev.bg ?? { Color.rand(0.80, 0.9).alpha_(0.5) }); Pen.font_(font); Pen.translate(u.bounds.width / 2, u.bounds.height / 2); Pen.scale(scaleFactor, scaleFactor); ev.pos !? { Pen.translate(ev.pos.x, ev.pos.y) }; P ...
-
... Nil, { orbit.set(key, val); }); }) }; } // Function to draw the grid drawGrid { Pen.color = Color.new255(150, 150, 150); Pen.width = 0.5; // Draw vertical grid lines (Input Level) (0..height).do { |x| if (x % (height / 10) == 0, {Pen.line(P ...
-
... a*2]; line.update; //--render line.render(1, 100); //1= exaggerate, 2= standard Pen.translate(width*0.5, height*0.5); Pen.strokeColor= Color.white; line.drawOutlines; Pen.fillColor= Color.white; line.draw(10); //dotSize }; w.play; CmdPeriod ...
-
... n( "Export selection as new SoundFile...", { ULib.savePanel({ |path| soundFile.openRead( soundFile.path ); soundFile.uExportSelection( path, startFrame: startFrame, numFrames: numFrames ); soundFile.close; }, {}, soundFile.path.dirname +/+ ...