- Home /
I want to add progress bar in my application, can anyone explain with one example.
Hi guys, I want to dispaly loader when my application is already performing one action, I want to show user a progress bar or anything similar of progress bar to show user please wait process is in progress.
Please it will great help for me if anyone explain me with some example
Thanks in advance
Hi, well, all you really need is a way to track the progress and display it in some visual form. Assu$$anonymous$$g that you know what value will deter$$anonymous$$e the progress displayed, all you really need is a way to know how to properly display the progress bar.
In this case, you'll could do just fine with a simple plane with a texture, that you scale according to the progress. You just have to remember that the size of the bar usually is a constant value while the progress itself might differ.
For example, you have to take probably at least 2 values into consideration when working on this: 1) actual value (for example, 500/500 would mean that the bar is full) 2) bar length on screen since it will depend on the progress and the screen resolution
You could either try to figure out how to code this yourself or try to look for examples, like..
http://answers.unity3d.com/questions/7846/how-do-i-make-a-progress-bar.html or http://answers.unity3d.com/questions/11892/how-would-you-make-an-energy-bar-loading-progress.html for example :)
@ ShadoX thanks for reply, shared links help but how I connect my progress bar with my process. I am fetching Data from server, progress bar should stop when process end. Please explain. Thanks in advance.
The general idea is that you have to know how much you're actually fetching from the server or else there's no real way of knowing when it's done. At last not in a way that would allow you to display a progress bar about the data being fetched.
Lets say, you're downloading a file. The only way the progress bar would work with that is, if it knows the file size and how much of it has been downloaded. (for example, downloading a 10 $$anonymous$$B file where you only have downloaded 1 $$anonymous$$B, would mean that the progress bar displays 10% as done)
So you most probably will want to get the size of the data that you're supposed to fetch and compare that value with the amount of data that is done fetching.
Your answer
Follow this Question
Related Questions
How to draw an arrow from fps contoller 1 Answer
getting high score of game from asp.net page 2 Answers
,Roll a ball - project 0 Answers
Mathf.pingpong 4 Answers
colliders with touch 0 Answers