Exemplo n.º 1
0
void Loader::setupPropertyKeysJson(Property<float>& prop, const ofJson& json, float scale, float offset)
{
	for(auto key = json.begin(); key != json.end(); ++key) {
		const string& name = key.key();
		int key_frame = ofToInt(name);
		float value = json.value(name, 0)*scale+offset;
		prop.addKey(key_frame, value);
	}
}
Exemplo n.º 2
0
void Loader::setupPropertyKeysJson(Property<ofFloatColor>& prop, const ofJson& json, const ofFloatColor& scale, const ofFloatColor& offset)
{
	for(auto key = json.begin(); key != json.end(); ++key) {
		const string& name = key.key();
		int key_frame = ofToInt(name);
		ofFloatColor value = ofFloatColor(json[name][0], json[name][1], json[name][2])*scale+offset;
		prop.addKey(key_frame, value);
	}
}
Exemplo n.º 3
0
void Loader::setupPropertyKeysJson(Property<bool>& prop, const ofJson& json)
{
	for(auto key = json.begin(); key != json.end(); ++key) {
		const string& name = key.key();
		int key_frame = ofToInt(name);
		bool value = json[name];
		prop.addKey(key_frame, value);
	}
}