tomis13lack Posted December 5, 2017 Share Posted December 5, 2017 Any variable or function I can call to check if it is loading? Trying to make a conditional for a loading screen Quote Link to comment Share on other sites More sharing options...
gamecreator Posted December 5, 2017 Share Posted December 5, 2017 You should be able to find a thread or two about this (search the forums for loading screen or similar) but my method (I'm also on C++) is to load everything myself and then load the map afterwards. Because you already have the models in memory, the map should then load very quickly. You can increment a counter for each model you load and you'll know how far along you are in the process. Something like: // Pseudocode temporaryentity[counter++]->load("tree1.mdl"); DisplayProgressbar(); temporaryentity[counter++]->load("tree2.mdl"); DisplayProgressbar(); etc. but coded nicer. At the end you'll know how big your counter is and you can use that as a total to divide by to get a percent loaded. Quote Link to comment Share on other sites More sharing options...
tomis13lack Posted December 5, 2017 Author Share Posted December 5, 2017 What does the DisplayProgressbar do? I would check (assuming it is not a function i am to make) but I do not have access to a working leadwerks, Quote Link to comment Share on other sites More sharing options...
gamecreator Posted December 5, 2017 Share Posted December 5, 2017 Sorry. It was pseudo code for a function you could create, not an actual function in Leadwerks. It would just display your progress bar based on the counter count (so the bar would get longer with each call). The function would look something like this, assuming counter is global. void DisplayProgressbar() { context->SetColor(0.0, 0.0, 1.0); context->DrawRect(0, 0, counter / totalcounter * 500, 50); context->Sync(); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.