cassius Posted November 13, 2015 Posted November 13, 2015 How do I do a black screen with the word "Loading" and load in all the assets while this screen is on? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Thirsty Panther Posted November 14, 2015 Posted November 14, 2015 There is a thread that talks about this. The title says Lua but others offer C++ options. http://www.leadwerks.com/werkspace/topic/11758-animated-loading-screen-with-lua/page__hl__loading+screen Quote
f13rce Posted November 14, 2015 Posted November 14, 2015 Assuming you're loading stuff in one big chunk, you can do something like: Texture *background = Texture::Load("./path"); context->SetColor(Vec4(1)); context->DrawTexture(background); context->DrawText("Loading...", 25, 25); context->Sync(); LoadAssets(); But if you want to have a progress bar for loading, you can seperate the loading part into functions like LoadModel(std::string path) and do: void LoadModel(std::string path) { models[ modelIndex ] = LoadModel(path); modelIndex += 1; RedrawScreen(); } void RedrawScreen() { itemsLoaded += 1; // Draw background here context->DrawRect(startX, startY, barLength / totalItems * itemsLoaded, barHeight); context->Sync(); } With the above code I'm assuming you pre-load your assets in a class where you can retrieve them from later. You could make the class static so that every class can reach it without having a reference, but that's kinda ugly 2 Quote Using Leadwerks Professional Edition (Beta), mainly using C++. Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz Previously known as Evayr.
cassius Posted November 14, 2015 Author Posted November 14, 2015 Thanks for replys. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
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.