News:

Function Finder  Find all the functions within source code files

Main Menu

Scale+Transparancy - Need Help

Started by basil99, June 29, 2005, 05:02:55 AM

Previous topic - Next topic

basil99

Hi !

I meet a problem making scaled transparency sprite. So, lets start.

I have an image with rgb( 0,0,255 ) ( pure blue ) as a transparency color.

I load image and create sprite as following:

   LoadImage filename$, 1
   ImageMaskColour 1, RGB( 0,0,255 )
   PrepareFXImage curimage
   ImageMaskColour 1, RGB( 0,0,255 )
   CreateSprite 1
   SpriteImage 1, 1
   SpriteColourReplaceKey 1, RGB( 0,0,255 )

then I tries to draw sprite as transparent and original size:

   SpriteDrawMode 1, 0
   DrawSprite 1

works Ok - sprite is transparent. Now I try to scale sprite 2 times:

   SpriteDrawMode 1, 2
   ScaleSprite 1, 2
   DrawSprite 1

nice ! I got scaled sprite, but transparency color ( blue - RGB(0,0,255) ) is visible.

So, question:

What I need to do to get SCALED and TRANSPARENT sprite AT THE SAME TIME ?

TIA
Free Games Site - http://vespacrabro.com

basil99

Funny, looks like I found the answer:

   SpriteDrawMode 1, 2+16384
   ScaleSprite 1, 2
   DrawSprite 1

do all the job I want.

A bit weird, cause I think SpriteColourReplaceKey 1, RGB( 0,0,255 ) command tells Pbasic to draw sprite transparent all the time until I stop it by SpriteTransparent SpriteIndex, TransparentFlag

Okay, sorted
Free Games Site - http://vespacrabro.com