rp5 create classic_sketch 200 200 --wrap rp5 watch classic_sketch.rb
Open a new console and 'vim classic_sketch.rb' or us another suitable editor
class ClassicSketch < Processing::App def setup size 200, 200 end def draw end end # ClassicSketch.new(x: 20, y: 20)
For instant gratification and to relocate the sketch on your display un-comment the last line of the sketch and save (also note this line was "not" required to run the sketch, rp5 run or rp5 watch takes care of creating a new instance of sketch for you). You only use this form to send parameters, such as 'x offset' to your sketch
class ClassicSketch < Processing::App def setup size 200, 200 end def draw end end ClassicSketch.new(x: 20, y: 20)The sketch updates auto-magically...
Already in the works for the next release is the possibility of placing the sketch on your screen using the config file '~/.rp5rc' so this is kind of redundant, but a post initialization hook might get added so you will be able to send all sorts of other parameters. Which are then available by overriding the post_initialization hook method (See Sandi Metz POODR)
Next change the background of your sketch
class ClassicSketch < Processing::App def setup size 200, 200 end def draw background 0 end end ClassicSketch.new(x: 20, y: 20)
Next create a blue box.
class ClassicSketch < Processing::App def setup size 200, 200 end def draw background 0 fill 0, 0, 200 rect 40, 50, 120, 100 end end ClassicSketch.new(x: 20, y: 20)
To create class wrapped P3D sketch just "rp5 create classy_sketch 200 200 p3d --wrap" actually it probably doesn't matter where you put the --wrap option after create (but the order of the other variables is important)...
No comments:
Post a Comment