Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fading Objects In And Out

Started by Bench3 Aug 15, 2012 at 9:35 PM 2 replies 1.7k views
Original Post
Bench3
Bench3
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
David.M
David.M
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.
Bench3
Bench3
Thanks
BeerNutts
BeerNutts

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)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.