I need to remove an image I have drawn after 30 seconds. I’m currently using the code:
To load and draw the image
if(ofGetElapsedTimef() - lastEventTime <= 30.0f){
lowResLogo.loadImage("logo.png");
lowResLogo.draw(500, 500);
}
Then I have tried the clear method to remove, but this does not do it.
if(ofGetElapsedTimef() - lastEventTime >= 30.0f){
lowResLogo.clear();
}
Am I missing something simple here?
I have managed to get the above code working by changes the timings of the statements. My problem now is how do I remove a string. I want to delete the string below off the app after a certain amount of time. How can this be done?
blissTwo.drawString(ofToString(countdown, 0), 600, 400);
// remove logo and coundown
if(ofGetElapsedTimef() - lastEventTime >= 29.9f){
lowResLogo.clear();
}
If I’m understanding you right, you just don’t draw the image if it’s been up too long:
ofClear(0, 0, 0, 1.f); // or whatever you want your background to be
blissTwo.drawString(ofToString(countdown, 0), 600, 400);
if(ofGetElapsedTimef() - lastEventTime <= 29.9f){
lowResLogo.draw();
}