--- PROCESSING_ROOT: /home/tux/processing-3.0a4 JRUBY: "true" sketchbook_path: /home/tux/sketchbook
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Showing posts with label rp5rc. Show all posts
Showing posts with label rp5rc. Show all posts
Saturday, 20 September 2014
Using libraries from processing-3.0a4 in ruby processing
Up to and including processing-2.2.1 the path to sketchbook was/is discovered by "reading" the preferences.txt configuration file for ruby processing. For processing-3.0a4 the name has changed (to allow different libraries/sketches to co-exist for different versions?). For processing-3.0a4 you can set the "sketchbook_path" in the ".rp5rc" file, works for me on linux see yaml file below (will override preferences.txt value).
Labels:
libraries,
processing-3.0a4,
rp5rc,
ruby-processing
Thursday, 4 September 2014
New features in ruby-processing-2.6.2
# Hooky class demonstrates how to use the post_initialize hook, # available since ruby-processing-2.6.2, to add additional attribute # in this case :background as an array of int (splat to color) # Not sure how clever it is to have multiple sketch instances. class Hooky < Processing::App attr_reader :back def setup size 200, 200 background(*back) end def post_initialize(args) @back = (args[:background]) end end red = [200, 0, 0] green = [0, 200, 0] blue = [0, 0, 200] colors = [red, green, blue] colors.each_with_index do |col, i| Hooky.new(x: i * 90, y: i * 90, title: "Hooky #{i}", background: col) end
Read more about post-initialization hooks in POODR by Sandi Metz.
Subscribe to:
Posts (Atom)
Followers
About Me
- monkstone
- I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2
