fade in/out

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

fade in/out

Post by Guest »

I'm having problems with the fader in irrlicht. I may not be using it correctly. Here's what i have:

Code: Select all

driver->beginScene(true,true,SColor(255,255,255,255));
driver->draw2DImage(SplashIntro,core::position2d<s32>(0,0),core::rect<s32>(0,0,256,256),0,video::SColor(0,255,255,255),true);	
 fader->fadeOut(4000);
env->drawAll();

driver->endScene(); 
if (fader->isReady())
{
   GameStatus = SPLASH1_ISLOADED;
}		
what i want to do is fade out SplashIntro, the problem is, is that it does't fade out, it just outputs a black screen. I may not be using the fader correctly so if someone can show me how to do it right, that'd be much appreciated
Acki

Post by Acki »

Well, I don't know exactly how to use the fadout...
But I think you should not use it between beginscene and endscene !?!?!

probably you have to add an image object and set the fadeout to it before you draw the scene...


CU, Acki
LaVerne
Posts: 2
Joined: Sat Sep 11, 2004 6:54 am
Location: Germany
Contact:

Post by LaVerne »

I am a bloody beginner with C++ and Irrlicht, but I think your problem sounds familiar:

Code: Select all

// Create a fader
gui::IGUIInOutFader* fader = device->getGUIEnvironment()->addInOutFader();

// Set the initial color to fade from to black 
fader->setColor(video::SColor(0,0,0,0));

// Fade
fader->fadeOut(4000);

driver->beginScene(true,true,SColor(255,255,255,255));
driver->draw2DImage(SplashIntro,core::position2d<s32>(0,0),core::rect<s32>(0,0,256,256),0,video::SColor(0,255,255,255),true);   
env->drawAll();

driver->endScene();
if (fader->isReady())
{
   GameStatus = SPLASH1_ISLOADED;
}
Try this and do the fading before you begin to draw the scene, that should do the trick.

LaVerne
"We interupt this program to annoy you and make things generally irritating" - Monty Python
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Or put

Code: Select all

if (fader->isReady())
{
   GameStatus = SPLASH1_ISLOADED;
} 
in the draw-loop perhaps?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Post Reply