-
Notifications
You must be signed in to change notification settings - Fork 94
Getting Started
Read platform requirements here. Before you start you might wish to install jruby on your system see jruby site, you will also need to install vanilla processing (processing-2.0.3 MacOSX, and preferably processing-2.1.0 for everyone else, although other versions may also work). You will also need to set your PROCESSING_ROOT
in your .rp5rc
configuration file, this is easiest done by running the SetProcessingRoot.pde
(see this gist) sketch from the vanilla processing ide. To install the latest processing on MacOSX you should try homebrew and jdk1.8.0 to run ruby-processing.
gem install ruby-processing
install_jruby_complete # uses wget to download and install jruby-complete-1.7.11.jar
rp5 unpack samples
rp5 run samples/contributed/jwishy.rb
Or if not using an installed jruby
rp5 unpack samples
rp5 --nojruby run samples/contributed/jwishy.rb
And voilà.
See also examples from the Learning Processing book, check out Learning Processing with Ruby, and download the examples (note many of the sketches will need updating for processing-2.0, and the latest ruby-processing).
Since the latest release bare sketches are preferred, although class wrapped sketches are still supported.
Because every sketch has a setup
method, called once at the start, and a draw
method, called continuously as it animates; Ruby-Processing includes a sketch creator to get you started on the right foot with the proper (minimal) boilerplate. Using rp5 create my_sketch 800 600
, will generate a Processing::App that's 800 by 600 pixels in size, and just displays a blank window.
def setup
size 800, 600
end
def draw
end
jruby -S rp5 create my_sketch --p3d 800 600
def setup
size 800, 600, P3D
end
def draw
end
See also
You may not have wget
installed, if so you can download the jar into the vendors
folder, before running 'install_jruby_complete`
Gem install didn't seem to create environment variable RP5_ROOT upon which ruby-processing depends. Adding this environment variable to the path of the gem seemed to do the trick. If you're getting some errors where you don't know what's going on this might be the issue. For permanent solution amend your .rp5rc configuration file.