-
... ts.do{|o, i| o.addForce(world.gravity); o.update; world.contain(o)}; //--render Pen.fillColor= Color.green(1, 0.4); world.objects.do{|o, i| Pen.fillRect(Rect.aboutRedObject2D(o)); }; }; w.play; CmdPeriod.doOnce({w.close}); )
-
... bject in it. draw to be used inside a drawHook or drawFunc; draws the object. asPenFunction returns a function for drawing asGUICode ( penClass ) returns GUI.pen style code as a compile string. penClass can be a Class or a String ( default ...
-
+ Pen { *splineCurve { arg point1, point2, cpoint1, cpoint2, div = 10; (0,(1/div)..1).copy.do({ |i| this.lineTo( ([point1.x, point2.x].splineIntFunction( i, cpoint1.x, cpoint2.x ))@ ([point1.y, point2.y].splineIntFunction( i, cpoint1.y, cpo ...
-
... center, rect.width.min( rect.height ) / 5, rect.width.min( rect.height ) / 4 ); Pen.line( square.leftBottom, square.leftTop ); Pen.lineTo( square.rightTop ); Pen.lineTo( square.right @ (square.top + (square.height / 2) ) ); Pen.lineTo( squa ...
-
... d_( Color.white.alpha_( 0.25 ) ) .drawFunc_({ |vw| var bounds, vals, size, def; Pen.color = hiliteColor; bounds = vw.bounds.moveTo(0,0); vals = this.unmap( vws[ \val ] ).linlin(0,1,bounds.height,0); size = vals.size; def = this.unmap( this. ...
-
... freq, \maxDur, osize, \amp, amp, \pan, pan]); }); world.contain(o); //--render Pen.strokeColor= Color.grey(o.mass/4, 0.7); Pen.strokeOval(Rect.aboutRedObject2D(o)); }; }; w.play; CmdPeriod.doOnce({w.close}); })
-
... margin; }; minSize = 250 @ 200; } makeViews { var font = Font("Monaco", 10); // Pen.font_(Font("", 12)); zone.resize_(5); // elastic h + v nameView = StaticText(zone, Rect(0,0,50, 20)) .font_(font).string_("weights"); inNameView = UserView( ...
-
... margin; }; minSize = 250 @ 200; } makeViews { var font = Font("Monaco", 10); // Pen.font_(Font("", 12)); zone.resize_(5); // elastic h + v nameView = StaticText(zone, Rect(0,0,50, 20)) .font_(font).string_("weights"); inNameView = UserView( ...
-
... rgs( string, buttons, actions, color, iconName ).init( background, border ); } openAgain { ^this.init; } init { |background, border| //var buttonViews; var charDict; color = color ? Color.red.alpha_( 0.75 ); buttons = buttons ?? {buttons = ...
-
... .drawFunc_({ |u| 4.do { |i| var shift = if (i.inclusivelyBetween(1, 2), 10, 0); Pen.addArc( (30 + shift) @ (i*32 + 15), 15, 0, 2pi); Pen.addArc( (90 - shift) @ (i*32 + 15), 15, 0, 2pi); Pen.fill; Pen.stringCenteredIn("NTMI-005", u.bounds.ex ...