Author Topic: Semi transparent sprites  (Read 2810 times)

Offline matty47

  • Mr. Drawsprite
  • **
  • Posts: 71
    • View Profile
    • Matt and Marg's Homesite
Semi transparent sprites
« on: 2007-Dec-01 »
I know that color 128,0,255 is treated as transparent when creating images for GLBasic sprites. How do I achieve a "fuzzy" edge for sprites. I created a 128 x 128 png with a pink background. I then drew a white circle on this. I then applied a gaussian blur to geve the edges a blurred effect. When I use this as a sprite there are pink tinges at the edge of the white. (Obviously the blur changes some of the pink background). I also tried doing this with a transparent background. With the transparent background the sprite looked as though it had sharp edges. I must be misunderstanding something. Any help please?
THanks
Matthew

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1793
    • View Profile
    • Homepage
Semi transparent sprites
« Reply #1 on: 2007-Dec-01 »
You need to save it as PNG, I use Photoshop but I'm sure Gimp can do it too. PNG preserves the partially transparent areas with the alpha channel. Then you add this line to your project, just before you draw the sprites:

Code: (glbasic) [Select]
ALPHAMODE -.999 // to make the alpha channel in PNG work

Offline matty47

  • Mr. Drawsprite
  • **
  • Posts: 71
    • View Profile
    • Matt and Marg's Homesite
Semi transparent sprites
« Reply #2 on: 2007-Dec-01 »
Thanks for the quick advice
Matthew