Jump to content
  • Advertisement
Sign in to follow this  
glhf

How do you make a loading bar?

This topic is 2290 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make a loading bar for while the game is checking for updates and downloading them.
How do I get started on this?

Share this post


Link to post
Share on other sites
Advertisement
All loading bars to is present the internal state of the program to the player. Store the percentage of completion in a variable somewhere and then read this when your rendering the bar to see how much you should fill in.

Share this post


Link to post
Share on other sites
Make a texture for your loading bar and then when drawing it, multiply the width of the bar at 100% completion by the current percentage. Like so:

[source lang="csharp"]Texture loadingTexture = LoadTexture("loadingBar");

float completionPercent = loader.PercentComplete;

Draw(loadingTexture, x, y, loadingTexture.Width * completionPercent, loadingTexture.Height);[/source] Edited by khagin

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!