PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Opacity in Lite Version?

Hi,

(newbie question)

Can the lite version of edgelib do opacity (like 50% transparency revealing the surface behind) on surfaces? If so, how?

And to follow that if I were to blit 2 surfaces A (with 50% opacity) and B on to parent surface C and I moved surface A on top of B would B show through from behind or would C?

I have attempted to find the answer through the documentation but I'm getting confused between RGBA surfaces and the surface blit flags. It's also hard to determine which features of the documentation pertain to which license version.

e.g.
"EFX_OPACITY //Pixel blending: opacity values range from 0 to 255"

Does that setting only work with RGBA surfaces???

I'm trying to determine which graphics library to go with and having opacity would be very preferable.

Thanks,
grae
Hi,

Yes, you can use opacity in the EDGELIB Lite edition. Here is a small example to blit a surface to the backbuffer and write a font with 50% opacity:

Code:

display->buffer.BltFast(0, 0, &surface;, NULL, EFX_OPACITY, 128);
display->buffer.DrawFont(0, 0, &display-;>fontinternal, "Test opacity", EFX_OPACITY, 128);


The surface doesn't need to be RGBA to use opacity.
Hi,

The opacity code works great! Thanks for the example. :)