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
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Loading screen

Post by Cleves »

Hey all,

I want to create a loading screen but i can't quite get the idea how to do it?
Can someone help me?

Thanks :D
Tequilla
Posts: 40
Joined: Mon Nov 10, 2003 3:42 pm
Location: Germany
Contact:

Post by Tequilla »

Ah, without any status indicator on the loading-screen it's easy:
Just view your loading-image with the gui on the screen, then let the engine load the map and finaly hide the image.
If you want to have a status indicator, I think you must create your own loading-function, which calls a function viewing the status-screen everytime more data is red and give the current status as parameter.

I hope I could help you.

BTW: That would be a nice feature to the engine: When you lode a mesh from file, you could give the getMesh()-function a class (eg called irr::scene::IGetMeshStatus), which have a user implimented function (eg CurrentStatus(float PerCent)) that is called from the engine when more data is red... How about that, Niko?
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

Hey,

The only problem is that i don't know when to hide image, or in other words when the engine completed loading everything.

Thanks
Tequilla
Posts: 40
Joined: Mon Nov 10, 2003 3:42 pm
Location: Germany
Contact:

Post by Tequilla »

Easy:
After initializing the device, you load the image to GUI, beginn scene, draw gui-elements (gui->drawAll() I think), end scene. Then you do all stuff needed for your game (loading map, models, initialize network and so on). After that you delete the image from the GUI and begin to render the scene (scenemanager->drawAll()) in the main-loop. you don't have to take care when the stuff is loaded. The code pauses automatically till all stuff is loaded.
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Do this...

Code: Select all

gui::IGUIImage* Loading_Img;
Loading_Img = guienv->addImage(rect<int>(0,0,0,0)); //adjust the 0's for the image
Loading_Img->setImage(driver->getTexture("loading.jpg"));
Loading_Img->draw();
//---To Remove the image
Loading_Img->remove();
That should work...
Tequilla
Posts: 40
Joined: Mon Nov 10, 2003 3:42 pm
Location: Germany
Contact:

Post by Tequilla »

Loading_Img = guienv->addImage(rect<int>(0,0,0,0)); //adjust the 0's

Hmm... I'm not sure, but I think it should be rect<s32>(0,0,ResX,ResY)
By defining 0,0,0,0 you get a rectangle sized 0x0pixels :-\
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

Yes Tequilla i already modified it.it should be rex,resy.

Thanks a lot guys :D
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Tequilla wrote:Loading_Img = guienv->addImage(rect<int>(0,0,0,0)); //adjust the 0's

Hmm... I'm not sure, but I think it should be rect<s32>(0,0,ResX,ResY)
By defining 0,0,0,0 you get a rectangle sized 0x0pixels :-\
I told him to modify it... read my post again.
Loading_Img = guienv->addImage(rect<int>(0,0,0,0)); //adjust the 0's for the image
Tequilla
Posts: 40
Joined: Mon Nov 10, 2003 3:42 pm
Location: Germany
Contact:

Post by Tequilla »

Oh, sorry.. I should read the comments more carefully ;)
Post Reply