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 › Fade in images & Check mouse is over applet
Page Index Toggle Pages: 1
Fade in images & Check mouse is over applet (Read 1589 times)
Fade in images & Check mouse is over applet
Dec 1st, 2009, 6:45am
 
Hi guys, i've been working on a navigation/header image for a website and i've come across a couple of problems so far:

1. How can you fade an image in (PImages don't have an opacity value)
2. How can you check whether the mouse is over the applet or not (mouseX/mouseY don't work to well for checking if the mouse is over the applet)

Also does the ESS library stop applets working online still? I't wouldnt work for ages until i commented out what i was going to use Ess for

Thanks everyone, keep up the great work Smiley always nice to see interesting new things here
Re: Fade in images & Check mouse is over applet
Reply #1 - Dec 1st, 2009, 7:49am
 
PImage sure does has an opacity value.
And I don't think you can reliability check (unless I miss something) mouse non over applet, as it goes beyond the scope of the applet, precisely.

I don't recall what ESS does but if is access hardware, it won't work, not without some effort (signing applet, etc.).
Re: Fade in images & Check mouse is over applet
Reply #2 - Dec 1st, 2009, 8:26am
 
You could use mouseEntered to determine if the mouse is over the applet (as in this demo).  Don't know what reliability issues you might encounter though...
Re: Fade in images & Check mouse is over applet
Reply #3 - Dec 1st, 2009, 8:46am
 
@PhiLho
How would you set the opacity to 50% for example then? The documentation mentions RGB, ARGB, ALPHA for the 'format' but i'm unsure on how to use them

@blindfish
thanks loads, that looks like it should do fine Smiley
Re: Fade in images & Check mouse is over applet
Reply #4 - Dec 1st, 2009, 9:15am
 
Interesting, blindfish.
Note from source (or API ref): "If you override this or any function that takes a "MouseEvent e" without calling its super.mouseXxxx() then mouseX, mouseY, mousePressed, and mouseEvent will no longer be set."

Opacity: show a simple example of what you want to do, I will show you how to get the effect you need.
Re: Fade in images & Check mouse is over applet
Reply #5 - Dec 1st, 2009, 1:49pm
 
as far as i know image transparency is achieved by using tint(255,alpha)
Page Index Toggle Pages: 1