blitting text

Started by mogli, July 19, 2006, 05:29:50 PM

Previous topic - Next topic

mogli

hi!

is it possible to blit a text having black as color?
i think black is used as the color who will be cleared. is there a way to take another color which should be used for this?

EgonOlsen

You have two options: Blit opaque, but then you won't have any transparent color. I'm not sure if that is, what you want in this case. If you want to have parts of the texture transparent that are not black and the black parts should be opaque, supply an alpha channel with the texture (for example by loading a PNG as the texture's image, because PNG supports alpha) and do a normal transparent blit. jPCT will then use the alpha channel of the image instead of the one it creates from the black sections of the image itself. There are some constructors in Texture to support alpha.

mogli

thx,

i use the last option and it works great.
but i load the image/s from a webserver.

is there a possibility that you add also a constructor for texture with docbase, filename and useAlpha because there is only one for using urls without useAlpha.

Mizuki Takase

How about changing your text color to an off black color like (1,1,1)~? I haven't tried that but I would think that would be the most easiest solution. Besides, I doubt that anyone can tell the difference between (1,1,1) and (0,0,0)...

EgonOlsen

Quote from: "mogli"is there a possibility that you add also a constructor for texture with docbase, filename and useAlpha because there is only one for using urls without useAlpha.
Yes, i'll add this. I simply forgot to add this variant, i suppose.

EgonOlsen

I've uploaded a modified jar at http://www.jpct.net/download/beta/jpct.jar that supports alpha in the URL-based constructor.

mogli

thx, that's very greate!