hello i been trying to make a custom fader for a video player control the fade in effects works like this Image may be NSFW.
Clik here to view.
if (fadeIn==true) {
times =ofGetElapsedTimef();
float phase = 1 * times;
float value = phase + kx;
if (kx<255) {
kx++;
}
ofxOscMessage m;
m.setAddress( "/ch1/set_alpha" );
m.addIntArg( kx );
oscSender.sendMessage( m );
}
it is control by pressing a key
but when im trying to do the same for fade out the alpha channel gets to 0 immediately and can fade in again can someone help what i wanna do is to control the time or seconds to get from 0 to 255 in the alpha channel and from 255 to 0
help!!!