Author Topic: blitting text  (Read 5895 times)

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
blitting text
« 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
blitting text
« Reply #1 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.

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
blitting text
« Reply #2 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.

Offline Mizuki Takase

  • int
  • **
  • Posts: 97
    • View Profile
blitting text
« Reply #3 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)...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
blitting text
« Reply #4 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
blitting text
« Reply #5 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.

Offline mogli

  • byte
  • *
  • Posts: 38
    • View Profile
blitting text
« Reply #6 on: July 31, 2006, 10:23:03 pm »
thx, that's very greate!