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
Loading screen
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?
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?
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.
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.
-
- Posts: 386
- Joined: Thu Sep 25, 2003 12:43 pm
- Contact:
Do this...
That should work...
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();
-
- Posts: 386
- Joined: Thu Sep 25, 2003 12:43 pm
- Contact:
I told him to modify it... read my post again.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 :-\
Loading_Img = guienv->addImage(rect<int>(0,0,0,0)); //adjust the 0's for the image