Can I blit some part from texture, and set it transparent?

Started by qjvictor, January 09, 2007, 10:07:30 PM

Previous topic - Next topic

qjvictor

The thing is that:
     I need a transparent log on the left top of the jPCT world, and I also notice that  some words blitted from a texture look much better if they are in a transparent background.
    So Can I blit some parts from a texture( a picture, maybe GIF, JPG or PNG), and set the parts transparent?
    It is not the issue about FrameBuffer.TRANSPARENT_BLITTING or FrameBuffer.OPAQUE_BLITTING, when I set the  FrameBuffer.TRANSPARENT_BLITTING, the background will be missed if it is black, and if not black, the background will be there. But I need it is transparent.

Melssj5

I guess you cannot blit a semi transparent texture, maybe if you texture has many black points on it that may be look trasnparent, but this is not a real solution if you log has small letters.
Nada por ahora

EgonOlsen

When using the software renderer, then no. You would have to do the transparency yourself on the bitmap level (not that hard).
When using the hardware renderer, then yes. You can load a Texture with an alpha channel (a PNG with alpha will work fine) to define the transparent/translucent parts and blit that in transparent mode. There are constructors for textures with alpha-channel in Texture.

Edit: An example using this picture:

qjvictor

Thanks.
I will try.

And I want to thank EgonOlsen and all the guys in the forum. You all really help me a lot.

And I will help out to others if I can about this excellent engine.

:)