← Back

ofxSemanticals

github.com/markkorput/ofxSemanticals · @markkorput
OF 0.8 Utilities

Semantic objects that wrap around low-level basic concepts and provide common functionality

0 0 Last commit 11y ago Created 11y ago

README

ofxSemanticals



Semantic classes that wrap around low-level concepts and provides often used functionality.

Sattribute



This class functions as a smarter attribute (though originally the name was short for Super-attribute).

keeps a history of previous values provides events to hook into to (beforeChange, afterChange, beforeSet, afterSet).

Quick Start



class Game { public: // constructor Game(){ score.set(0); ofAddListener(score.afterChange, this, &Game::onScoreChange); }

public: // (s)attributes Sattribute<int> score;

private: // callbacks void onScoreChange(Sattribute<int> &sattr){ int points = attr.get() - attr.prev(); ofLog() << "You just scored " << ofToString(points) << " point(s)." } };

Get this addon

HTTPS
SSH