interactive object GUI example

The objectEventExample is created as an alternate GUI and control interface for the Slice//Jockey program (Pure DAta) in openFrameWorks. It currently supports and demonstrates mouse events on arbitrary objects. These arbitrary objects can contain controllers for the Slice//Jockey functionality, the audio part ported to libPd.

The main goal is clicking and dragging objects on a canvas, and controlling parameters.

The demo application shows six geometrical figures which react on left mouse button clicks, mouse scroll and mouse drag actions. The latest clicked object is on top and selected when clicking a stack of multiple overlapping objects. There is a rudimentary provision to keep objects on the canvas and becoming too small. Right-clicking an object pushed it to the bottom of the stack.

The attributes of the objects are currently name, color and selected color. Name is not very useful now, but was handy during debugging.

Implementation

The objects are derived from EventObject which defines the basic structure and implements the common behaviour. The created objects are placed in a vector and for each operation, this vector is iterated. The method names are the same as generated by openFrameWorks, but the signature may differ.

On a left-mouse click (mousePressed()) the first object that detects being clicked, is selected and placed at the top of the vector. As the draw() method iterates in reverse, the first is drawn last and thus on top.

Limitations:

License

The software is licensed using the 2-clause BSD license, with the exception of the main.cpp, testApp.h, Makefile and config.make and portions of the testApp.cpp file which are copied from the openFrameworks 007 distribution.

Versions:


Latest update: 2012-06-14

Fred Jan Kraan