Skip to content

Using Contributed Processing Libraries

Martin Prout edited this page Aug 1, 2013 · 12 revisions

Installing processing libraries

Install regular processing, if you have not already done so ( this is highly recommended for users of external processing libraries, for Mac users can even use the downloaded binary in the vendors folder, to install vanilla processing ). Since processing-2.0 it is possible to install many Contributed libraries directly via the processing ide (see Contributed where some Legacy libraries are also listed). Other processing libraries should be manually installed following the Legacy libraries instructions. However some Legacy and other libraries may need updating to work with processing-2.0 (and hence ruby-processing-2.0+).

Loading processing libraries in a sketch

You can simply load_library or load_libraries to load the required libraries (if installed as above), will also either need to java_import, or sometimes it is better to include_package to access the java classes. It can be convenient to create a module to access these packages via a module as below. Read more about calling java from ruby at the JRuby Wiki.

load_libraries 'simutils','toxiclibscore','colorutils'

module Toxi
  include_package "toxi.sim.grayscott"
  include_package "toxi.math"
  include_package "toxi.color"
end

See the included External Library examples

Clone this wiki locally