Page 1 of 1

TransparentSpriteColor?

Posted: Sat Aug 29, 2020 4:00 pm
by ricardo_sdl
Hi!
On PureBasic I'm using TransparentSpriteColor to set a color as transparent (the background color of all my sprites). But this command is not present on SpiderBasic (I'm trying to create a code base that compiles on both PureBasic and SpiderBasic). How could I implement this behavior on SpiderBasic?
Thank you all!

Re: TransparentSpriteColor?

Posted: Sat Aug 29, 2020 5:07 pm
by plouf
There is DisplayTransparentSprite which use alphachannel (png 32bit)

Re: TransparentSpriteColor?

Posted: Sat Aug 29, 2020 5:09 pm
by Paul
Convert your Sprites to PNG with transparency layer and use those instead.

Both PB and SB will load the transparent sprite with LoadSprite() and the #PB_Sprite_AlphaBlending flag and display with DisplayTransparentSprite().
You also get the cleanest and smoothest edges compared to keying out a single color with TransparentSpriteColor()

Re: TransparentSpriteColor?

Posted: Sun Aug 30, 2020 10:06 pm
by ricardo_sdl
Thanks! That's the way to go!