www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: mogli on July 19, 2006, 05:29:50 pm

Title: blitting text
Post by: mogli on July 19, 2006, 05:29:50 pm
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?
Title: blitting text
Post by: EgonOlsen on July 19, 2006, 05:42:13 pm
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.
Title: blitting text
Post by: mogli on July 20, 2006, 09:22:22 am
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.
Title: blitting text
Post by: Mizuki Takase on July 28, 2006, 07:56:33 pm
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)...
Title: blitting text
Post by: EgonOlsen on July 30, 2006, 04:39:25 pm
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.
Title: blitting text
Post by: EgonOlsen on July 31, 2006, 09:05:34 pm
I've uploaded a modified jar at http://www.jpct.net/download/beta/jpct.jar that supports alpha in the URL-based constructor.
Title: blitting text
Post by: mogli on July 31, 2006, 10:23:03 pm
thx, that's very greate!