-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
combine ofxTweenzor and ofParameter for ofxGui #8
Comments
That is a good question. I don't have a lot of experience using ofxGui. But it sounds like the gui does not know that the ofParameter is changing it's value. Being able to pass an ofParameter to ofxTweenzor directly would be a nice feature. I will look into implementing this functionality into the addon. |
Hi Nick ! Well ... finally i could solve it with something that i can't understand but I tried when reading twice your answer about "call update on the ofParameter while the tween is running". So I add on update :
I would have said that this instruction was not going to change anything. But it did ? I put here my code in case you want to add it as an ofParameter example (needs ofxGui). testApp.h
#pragma once
testApp.cpp
#include "testApp.h"
|
The need for calling _x1 = _x1 is that ofxTweenzor is directly modifying the pointer value of the float passed in. The ofParameter has no way of knowing this is happening. OfParameter overrides operator functions like =, *= +=, etc. when these functions are called, it knows that it has been updated and can be displayed accordingly. Hope this helps Nick Typed on a tiny keyboard
|
Hi Nick !
Not really and issue at all, just asking for some problem ...
I'm facing a trouble i posted on the OF forum (http://forum.openframeworks.cc/t/combine-tweezor-with-ofparameter-in-ofxgui/18987).
What I'm trying to achieve is that an ofxGui slider is tight to ofParameter and this float is being driven by a Tweenzor.
As far as i understand what is going on this should make it 👍
.h
ofParameter_x2;
.cpp
gui.add(_x2.set( "x2", 0, 0, ofGetWidth() ));
Tweenzor::add((float *)&_x2.get(), 0, ofGetWidth(), 0, 4,EASE_IN_OUT_EXPO);
what i get is that when the Tweenzor is acting, the value is being driven by Tweenzor (as expected), but my problem is that the ofxGui slider is not updated with the values being driven by the Tweenzor ... when the Tweensor ends, then i do can play with the slider and i see the resulting linked value correctly... so something is broken while the Tweenzor is driving the value ...
Maybe i'm confused about it ...
Does my question make sense ? Is it possible to link an ofParameter to a Tweenzor and see the gui widgets updated with Tweensor values ?
The text was updated successfully, but these errors were encountered: