April 26, 2024, 06:32:27 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Is there anyway to set the alpha transparency of a 3dSprite?

Started by Kale, November 07, 2006, 03:53:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kale

Is there anyway to set the alpha transparency of a 3dSprite? So i can display 3DSprites at 50% opacity for example?

Ionic Wind Support Team

There are a few ways. 

#1 Use the alpha channel of the image, for example PNG supports per pixel alpha transparancy.

#2 use the SetModulateColor method.  The RGBA function lets you specify the alpha value:

sprite->SetModulateColor(RGBA(255,255,255,128));

Would give you 50% transparency for the entire image.  As demonstrated in the '3Dsprites.src' example program included with Aurora.

#3 use color keying when you load the texture.  As you found out already.
Ionic Wind Support Team

Kale


Ionic Wind Support Team

You can also use SetModulateColor to 'tint' the sprite by the way. 

sprite->SetModulateColor(RGBA(255,100,100,128));

Reduces the green and blue channels giving the sprite more of a red hue while showing it at 50% transparency. 
Ionic Wind Support Team