1

How would I make an Image have a pulsating effect to it? I already know how to draw an Image to the screen, so I just need to know how I can add a pulsating glow effect. Would I need to use tons of threads?

Also, how would I make some text have the same pulsating glow effect?

I want to be able to draw this to the screen so this needs to be a graphics object (g.drawString(glowingText, x, y);).

Thanks in advance!

Dylan Wheeler
  • 6,928
  • 14
  • 56
  • 80
  • You need to provide some sort of example of what you want to do as your question is not really clear enough to provide much input. – mcfinnigan Sep 27 '11 at 11:58

1 Answers1

2

AlphaTest shows one approach using Alpha Composite; FlashTest shows another using getHSBColor(). You can infer which is more popular.

Addendum: To get a pulsating glow behind some text or image, you'll want to vary the background alpha instead of the foreground. There's a related example here. I often use this utility to preview the effects of different composite modes.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • The links above point to [Short, Self Contained, Correct (Compilable), Examples](http://sscce.org/)s. – trashgod Sep 27 '11 at 20:52
  • Those are okay, but I am looking for a PULSATING GLOW behind some text or an image. – Dylan Wheeler Sep 27 '11 at 21:44
  • Ah, I see. I've elaborated above. – trashgod Sep 27 '11 at 21:55
  • No, `Translucent` just shows how to make the background translucent. All you really need is `AlphaTest`, which shows how to use alpha and the Timer. Just set the composite before you paint the background and set it back to 1 when you draw the foreground. Edit your question to include your [sscce](http://sscce.org/). – trashgod Sep 28 '11 at 02:02