Solved How would I do fading images?

Hi

So I have a custom class (based off of stuff I found on JGO) for loading images and textures. However, I would like to make images fade out.

Pastebin: http://www.java-gaming.org/?action=pastebin&id=985

If anybody has ideas about how I would make an image fade in or out, please share :slight_smile:

CopyableCougar4

A super easy way is to just change the alpha value.

To fade the image out, reduce the alpha. To fade it in, increase the alpha.

I use my own loading, no slick, so how would I draw the alpha layer? I know the quad part, but what color would I bind? (ie. What r, g, and b components?)

CopyableCougar4

GL11.glColor4f(red, green, blue, alpha);

4f meaning 4 float values.

I know that :P, but what rgb values specifically should I use? (I already know what alpha value to input)

Generally you would use all white unless you want to tint the texture’s color. All values (except for alpha) are 1 for a white color.

Ok thanks I will try that :slight_smile:

If you want to get really specific and/or screw around a look at OpenGL’s blending functions. You can get a lot of interesting effects, I’ve found, by playing around with it.