Fading Objects In And Out

Started by
2 comments, last by BeerNutts 11 years, 8 months ago
Hi, i've been attempting to make a game and was wondering how to make objects (such as rectangles) in and out from a JPanel. Can anybody help me out?

Thanks in advance,
~Ben
Advertisement
Change the color you use. Start out with a color that is mostly (or all) transparent (low alpha) then raise the alpha over time to 255 (fully opaque).

Edit: Thanks BeerNutts. Had it backwards.
Thanks :)

Change the color you use. Start out with a color that is mostly (or all) transparent (high alpha) then lower the alpha over time to 0 (fully opaque).


You said that backwards. High alpha is opaque (255 is fully opaque), and low alpha is transparent (0 is invisible).

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

This topic is closed to new replies.

Advertisement