[Etoys] alpha property
peace_the_dreamer at yahoo.com
Sun Apr 26 16:33:25 EDT 2009
Hi Bert, Hi Karl,
--- On Sat, 4/25/09, Bert Freudenberg <bert at freudenbergs.de> wrote:
> From: Bert Freudenberg <bert at freudenbergs.de>
> Subject: Re: [Etoys] alpha property replied:
> It's a trade-off. At 16 bpp we have to shove around
> only have as much data as in 32 bpp. Our painting tools do
> not support alpha transparency. If you use translucency and
> gradients, powerful tiles like color-sees do not work as
> well. That's also the reason why we don't smooth
> rotated sketches, because it alters the colors.
> Now that said, we actually do support alpha transparency in
> 16 bpp.
That surprised me. And good news.
This means that you can get a transparent picture.
You need to start off with a ColorForm (All gif images are read in as such.)
Put it somewhere you can get at.
Such as a BitmapFill form or ImageMorph image. Sketches are aggressively opaque.
myColorForm colors: ( myColorForm colors collect: [ :each | each alpha: myAlpha. )
myAlpha can come from an Imagemorphs color ivar alpha.
For Morphs with bitmapFills you need to use a sliders numeric value
suitably scaled between 0 and 1 inclusive. In my experimenting I found that coloring most morphs would remove its bitmapFill to give it a solid color.
I have experimented with a gif generated picture as a bitMapfill and found the above technique works. Albeit somewhat fragily because the fill can be removed out from under me by other user interations. Then I will get a debug box or other errors.
I have not tried to do this with tiles.
> One could do the same for images. Perhaps even
> more powerful would be a special kind of holder that would
> adjust all its childrens' transparency. That way, any
> object could be made translucent by embedding.
Hmmm. Now there is an idea generator.
Thanks Bert, knowledgeable and constructive as usual.
Yours in curiosity and service, --Jerome Peace
More information about the etoys-dev