PDA

View Full Version : REALbasic: Transparent Picture/Sprite


LordFire
2002.04.29, 10:47 AM
g'day

I'm having problems trying to make a transparent sprite in RB4. The code I'm using is pretty much as follows. I want to have a image of a 256 grey colour cloud with a 256 grey colour mask to it looks transparent.

// create the picture
clonecloud = newpicture(128,128,32)
// copy cloud image in to picture
clonecloud.Graphics.DrawPicture cloud,0,0
// copy cloud mask in to mask of picture
clonecloud.Mask.Graphics.DrawPicture cloudmask,0,0
// make the sky sprite
sky = spriteSurface1.NewSprite(clonecloud,64,64) // add the cloud sprite
// update so we can see the sprite
window1.spriteSurface1.update

The above, doesn't work, can anyone see a problem? Or am I missing something?

ChrisD
2002.04.29, 01:12 PM
8 bit masks don't work in RB.
Never did.

Try reading the online help file on sprites.

If you want 8 bit masks try using Rb3D...
it will give you full translucency etc.

Adn its easy to use...