Calico Processing

From IPRE Wiki
Jump to: navigation, search

Calico Processing is a module for developing digital works of art, data visualizations, interactive applications and animations. It offers Calico programmers the option to work with the familiar Processing command set. If you are familiar with Processing, use Calico and this module to explore new programming languages. If you have Calico already, this module will let you create stunning visualizations in any Calico programming language.

About

The Calico Processing module attempts to be faithful to the Processing command set, including function names, arguments, and usage. The majority of the command set has been implemented, although some differences exist. See Differences for details.

The Processing language is a subset of Java with a wide variety of commands included for creating visualization and animations. The Calico Processing module brings the Processing command set to Calico programming languages. This module does not make use of the Java language syntax. Instead, native data types and control structures of your chosen Calico language will determine how your application is constructed.

Command Reference

For a complete list of all Calico Processing commands, definitions, and examples of usage, visit Calico Processing Reference.

Differences

We rely upon the native programming language for the following capabilities.

  • Data structures
  • Program control (conditionals, iterations, etc.)
  • Files and file access
  • String functions
  • Objects and inheritance

The function window() is used to create sketch window.

Mouse and keyboard events are not handled by implementing predefined functions. The Calico Processing module raises events, which are handled by the native language event handling syntax. Events raised by the module include the following.

  • onMousePressed
  • onMouseReleased
  • onMouseClicked
  • onKeyPressed
  • onKeyReleased

Loops are implemented by handling a timer tick event named onLoop.

Certain predefined fields in Processing are implemented as functions.

  • mouseX and mouseY are implemented in Calico Processing as the functions mouseX() and mouseY().
  • pmouseX and pmouseY are implemented as pmouseX() and pmouseY().
  • width and height are implemented as width() and height().
  • displayWidth and displayHeight are implemented as displayWidth() and displayHeight().
  • focused and frameCount are implemented as focused() and frameCount().
  • the booleans keyPressed and mousePressed are implemented as a function called isKeyPressed() and isMousePressed()
  • key is implemented as key() and returns they key as a string not at char.
  • the functions fullscreen() and unfullscreen() can be used to toggle fullscreen mode

There are many, many examples of the Calico Processing library that come with Calico, both in Python and Jigsaw.