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


by ricardo_sdl Sat Aug 29, 2020 4:00 pm

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:
Posts: 92
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: TransparentSpriteColor?

by plouf Sat Aug 29, 2020 5:07 pm

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

Re: TransparentSpriteColor?

by Paul Sat Aug 29, 2020 5:09 pm

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

Re: TransparentSpriteColor?

by ricardo_sdl Sun Aug 30, 2020 10:06 pm

Thanks! That's the way to go!
You can check my games at:
Return to Game Programming

Who is online

Users browsing this forum: No registered users and 1 guest