The live.rb code
# An pry shell for live coding. # Will start with your sketch. require_relative 'base' Processing.load_and_run_sketch ARGV.clear # So that pry doesn't try to load them as files. require 'pry' $app.pry
The sketch k9 create fred 300 300 --wrap
class Fred < Processing::App def setup sketch_title 'Fred' end def draw end def settings size 300, 300, FX2D # smooth # here end end
k9 live fred.rb
Turns out it was a really lucky choice to experiment with FX2D sketch (as there might be threading or other issues with JAVA2D), another strategy that seemed to work well is to redefine the sketch draw loop from pry (still can't see a serious use case, but it is a bit of fun). IRB can handle a yield block in draw loop (with block_given? guard) but it doesn't play too well with pry.
No comments:
Post a Comment