Loading screen?

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

Loading screen?

Post by Guest »

Is there anyone who knows how to make a loading screen like.. currently my game runs ok.. but the loading takes a loonng time
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

I draw an image that says "loading", while my game is loading the map and models.Is that what you want? :)

You can look inte the 2D graphics tutorial on how to display 2D images.
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

The TechDemo has a loading screen.
Crud, how do I do this again?
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

My game Supa G has splash screens and a loading screen. Just follow the link below and then go to the downloads page. BTW, The older v0.3.6 source may be easier for you to follow than the newer v0.3.8 source.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

example code:

Post by keless »

Code: Select all

loadingScreen(irr::s32 percent) {
	
	static irr::video::ITexture * loadbar = NULL;
	if(!loadbar) loadbar =  m_driver->getTexture("data/progressbar.BMP");

	m_driver->beginScene(true, false, irr::video::SColor(0,0,0,0));

	irr::gui::IGUIFont* font = m_env->getBuildInFont();

	font->draw(L"LOADING", irr::core::rect<irr::s32>(50, 100, 50 + 200, 150), irr::video::SColor(255,255,255,255)); 

	irr::core::rect< irr::s32 > clip(50, 50, 50 + (256 * percent/100) , 50 + 32);

       if(loadbar) m_driver->draw2DImage(loadbar, 
        irr::core::position2d< irr::s32 >(50,50), 
        irr::core::rect< irr::s32 >(0,0,256,32),
        &clip,
        irr::video::SColor(255, 255, 255, 255),
        false
        );

    m_driver->endScene();

}
in the part of your code that loads stuff, simply call loadingscreen(somenumber) where somenumber is how far you've finished loading.

ie:

initialize() {

loadingscreen(0);
//load some images;
loadingscreen(10);
//load a model
loadingscreen(30);
//load a bsp level
loadingscreen(55);
//load some random other stuff
loadingscreen(70);
//initialize some final stuff
loadingscreen(85);
//pretty much done now
loadingscreen(100);
}

this will send updates to the screen with the loading bar being more and more complete. you can use my loading bar if you want:
http://www.skyesurfer.net/keless/IrrLic ... essbar.bmp
a screen cap is worth 0x100000 DWORDS
Post Reply