QUESTION/SUGGESTION: Transparancy mask for DynamicSprite

Started by GarageGothic, Fri 15/09/2006 20:36:58

Previous topic - Next topic

GarageGothic

After the new DynamicSprite commands were introduced, I've started using them for a great many effects. Often I RawDraw a sprite to the background, use RawDrawRectangle and RawDrawTriangle with RGB color (255, 0, 255) to clip the sprites - and then, when using DynamicSprite.CreateFromBackground, the pink areas simply become transparent in the DynamicSprite. However, I fail to achieve the same effect when trying to use a sprite featuring the color (255, 0, 255) as a mask, which would allow for more detail and smoother edges. Here's what I've tried:

1) Importing a 2 color paletted sprite with (255, 0, 255) in index 1 and choosing index 0 as the transparent color. The result was that the colors got switched in the palette (i.e. the areas I wanted pink are white, and the rest of the sprite will end up translucent when RawDrawn). Same thing happens if I choose top-left pixel for transparency on import even if that pixel is NOT pink.

2) Importing a 32 bit sprite with alpha channel and pink areas opposite of alpha channel. Result is that pink areas are RawDrawn as intended (visible). This seemed to work, but when a new DynamicSprite is created from the background, the pink areas are NOT transparent as they are when using normal RawDraw routines.

I can't think of any other ways, so unless someone knows of a way to make this work, I'd like to suggest this (something  I suggested before, in a beta release thread but which never made it into the tracker):

SUGGESTION: The ability to copy transparency/alpha channel (if 32 bit) from existing sprite to DynamicSprite of the same dimensions. This would be an enormous help in some of the effects I'm trying to achieve. (if possible, an optional variable could select whether the new alpha channel should replace or add to existing alpha channel, but this isn't strictly necessary).

Pumaman

I remember you suggesting this before; would anyone else find it useful?

SMF spam blocked by CleanTalk