question on text color

Hi,

I am using to Java2D for drawing some string to a texture and then using it in a quad:

		
		GlyphVector glyph = text.font.createGlyphVector(new FontRenderContext(
				null, true, true), text.string);

                BufferedImage image = new BufferedImage((int) text.width, (int) text.height,
				BufferedImage.TYPE_4BYTE_ABGR);
		Graphics2D java2d = (Graphics2D) image.getGraphics();
		java2d.setFont(text.font);
		java2d.setPaint(text.color);
		java2d.drawGlyphVector(glyph, text.x, (int) (text.y + text.height));

But the text always appear as black. The value of the color above is like this:


		color = new Color(0.9f, 0.9f, 0.9f, 1.0f);

What could be wrong that makes the text always appear as black?

The texture is multiplied by the value set in glColor*(…)

Try to set it to glColor4f(1,1,1,1) to ensure the texture-color is not modified.

I found out what the problem was. It was the lighting. I had tried to disable the lighting but for some other problem in the code it didn’t work and I removed it. The solution was to set the correct BlendFunc and disable the Lighting after setting the projection to 2D.

I looks like I have still a long way to go with OpenGL. :slight_smile: