Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Fading Objects In And Out

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 Bench3   Members   

126
Like
0Likes
Like

Posted 15 August 2012 - 03:35 PM

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

Edited by Bench3, 15 August 2012 - 03:36 PM.


#2 David.M   Members   

731
Like
1Likes
Like

Posted 15 August 2012 - 05:59 PM

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.

Edited by David.M, 16 August 2012 - 03:36 PM.


#3 Bench3   Members   

126
Like
0Likes
Like

Posted 16 August 2012 - 02:27 AM

Thanks :)

#4 BeerNutts   Members   

4380
Like
0Likes
Like

Posted 16 August 2012 - 06:50 AM

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)




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.