Skip to content

A barebone UI library for processing that makes mouse-interactions with objects easy.

License

Notifications You must be signed in to change notification settings

the-leonat/poui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POUI - Processing Object User Interface is a barebone UI library that makes mouse-interactions with objects easy.

Download

You can install the latest version of POUI from within Processing via the menus Sketch > Import Library… > Add Library…

Usage

POUI consists of two interface classes Renderable and Touchable and a bit of glue code you have to implement.

Make sure your interactable object implements both interfaces and also add it to your POUI instance.

void setup() {
    OUI p = new OUI(this);
    MyObject o = new MyObject();
    p.addRenderable(o);
    p.addTouchable(o);
}

void draw() {
    p.render();
}

Interface Methods

These are the interface methods you have to implement.

Look at the example code in the processing examples menu under File > Examples > Contributed Libraries > Processing Object User Interface

void render();
// in here goes your render code for your object.

void applyTransformation(PGraphics _c);
// apply global opengl transformation before render

void renderToTouchSurface(PGraphics context, int actionIndex, int color);
// here you render hidden surface which will be touchable later.
// it is recommended to use same shapes at same positions as in your render() code.

void onHover(int actionIndex, boolean in);
// called when the mouse hovers over a touchable surface.

void onClick(int actionIndex, boolean in);
// called when a touchable surface is clicked.

void onDrag(int actionIndex, boolean in);
// called when a touchable surface is dragged.

About

A barebone UI library for processing that makes mouse-interactions with objects easy.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published