TransparentSpriteColor?

Advanced game related topics
ricardo_sdl
Posts: 22
Joined: Fri Jan 10, 2020 12:30 pm

TransparentSpriteColor?

Post 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!
You can check my games at:
https://ricardo-sdl.itch.io/
plouf
Posts: 97
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: TransparentSpriteColor?

Post by plouf »

There is DisplayTransparentSprite which use alphachannel (png 32bit)
Christos
User avatar
Paul
Posts: 113
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada
Contact:

Re: TransparentSpriteColor?

Post 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()
ricardo_sdl
Posts: 22
Joined: Fri Jan 10, 2020 12:30 pm

Re: TransparentSpriteColor?

Post by ricardo_sdl »

Thanks! That's the way to go!
You can check my games at:
https://ricardo-sdl.itch.io/
Post Reply