← Back

ofxDisplayStackObject

github.com/paulobarcelos/ofxDisplayStackObject · @paulobarcelos
OF 0.12 Releases Animation

openFrameworks addon for composing drawable objects in a lightweight Flash-style transform hierarchy.

12 3 Last commit 4mo ago Created 16y ago

README

ofxDisplayStackObject



openFrameworks addon for composing drawable objects in a small Flash-style display hierarchy.

Each ofxDisplayStackObject has its own position, scale, rotation, and color, and child objects inherit their parent transforms. It is useful for older sketches that want a lightweight scene graph without bringing in a larger animation or UI framework.

The name DisplayStack was chosen to avoid confusion with OpenGL display lists.

Usage



ofImage image;
ofxDisplayStackObject parent;
ofxDisplayStackObject child;

void ofApp::setup(){
    image.load("image.png");
    image.setAnchorPercent(0.5f, 0.5f);

    parent.setBaseObject(&image);
    child.setBaseObject(&image);
    parent.pushChild(&child);
}

void ofApp::draw(){
    parent.position.x = ofGetWidth() / 2;
    parent.position.y = ofGetHeight() / 2;
    child.position.x = 120;
    parent.draw();
}


Compatibility



Tested with openFrameworks 0.12.1 on macOS.

This addon comes from an older fixed-function OpenGL era. The current release replaces the addon-owned matrix and color calls with openFrameworks drawing helpers, but projects using programmable-renderer-only code should still test their exact render path.

The example includes the standard openFrameworks Makefile flow:

cd example
make Debug
make RunDebug

Get this addon

HTTPS
SSH

Latest release

1.0.0 ofxDisplayStackObject 1.0.0 published 4mo ago
First semantic release of ofxDisplayStackObject.

  • Modernizes the example window setup and Makefile build.
  • Replaces addon-owned fixed-function matrix/color calls with openFrameworks drawing helpers.
  • Fixes standard-library namespace issues for current C++ builds.
  • Refreshes the README with usage and compatibility notes.
Verified with make Debug using openFrameworks 0.12.1 on macOS.