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.
Page Index Toggle Pages: 1
mouseMoved() (Read 243 times)
mouseMoved()
Feb 13th, 2009, 3:13pm
 
good afternoon Smiley

i have problems with solving the following:

there are animated gifs and a static picture
if the mouse moves, the gifs should be shown, (without static picture)
if the mouse is not moved, the static picture should be faded in, the gifs schould be faded out.

how can i realise that?

my source code so far:

void draw() {
 background(bg);
 mouseAktuell=mouseX;
 image(rabe, mouseX, mouseY, 50,70);
}

void mouseMoved(){
if(mouseX<mouseAktuell){
   image(loopingGif1r, mouseX, mouseY);
   imageMode(CENTER);
   mouseAktuell=mouseX;
}

if (mouseX>mouseAktuell){  
   image(loopingGif1l, mouseX, mouseY);
   imageMode(CENTER);
    mouseAktuell=mouseX;
}
}

but (of course) the static picuture rabe is shown the whole time...


PLEASE give me some advice, hint, help or else Smiley
thanks, carina
Page Index Toggle Pages: 1