IonicWind Software

Aurora Compiler => 3D Graphics => Topic started by: Kale on November 07, 2006, 03:53:09 PM

Title: Is there anyway to set the alpha transparency of a 3dSprite?
Post by: Kale on November 07, 2006, 03:53:09 PM
Is there anyway to set the alpha transparency of a 3dSprite? So i can display 3DSprites at 50% opacity for example?
Title: Re: Is there anyway to set the alpha transparency of a 3dSprite?
Post by: Ionic Wind Support Team on November 07, 2006, 05:11:44 PM
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.
Title: Re: Is there anyway to set the alpha transparency of a 3dSprite?
Post by: Kale on November 08, 2006, 01:03:05 AM
Great thanks, i'll try 'SetModulateColor'.
Title: Re: Is there anyway to set the alpha transparency of a 3dSprite?
Post by: Ionic Wind Support Team on November 08, 2006, 02:10:04 AM
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. 
Title: Re: Is there anyway to set the alpha transparency of a 3dSprite?
Post by: Kale on November 08, 2006, 03:42:59 AM
Cool!