We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Help with Image!!!!
Page Index Toggle Pages: 1
Help with Image!!!! (Read 627 times)
Help with Image!!!!
Oct 14th, 2009, 11:18am
 
Hey, i have a clock, when the clock gets to a certain date i want an image to appear instead of the clock.basically i want the image to appear on the 21st day of this month.

here is my code so far..when running this code the clock appears. any help would be brilliant

adh mor


PFont font;

void setup(){
 //noLoop();
 size(500,500);
 PImage img;
 img = loadImage("gervais.jpg");
 font = loadFont("Serif-48.vlw");
 textFont(font);
}

void draw(){
 background(0);
 int y =year();
 int m =month();
 int d=day();
 int h=hour();
 int mi=minute();
 int s=second();
 int gervais = 21;
 
 
 
 
 String t =nf(y,2)+":"+nf(m,2)+":"+nf(d,2)+":"+nf(h,2)+":"+nf(mi,2)+":"+nf(s,2);
 text(t,50,250);
}

Re: Help with Image!!!!
Reply #1 - Oct 14th, 2009, 1:38pm
 
You must add something like:
if (d == 21) image(img, 0, 0);
Re: Help with Image!!!!
Reply #2 - Oct 14th, 2009, 4:28pm
 
this is the third "countdown" clock question this week...is this for a class assignment?
Re: Help with Image!!!!
Reply #3 - Oct 14th, 2009, 9:17pm
 
same thought here Smiley
Page Index Toggle Pages: 1