ProgressBar? With Crash's Slider class.

Posts 1–15 of 28 · Page 1 of 2
ProgressBar? With Crash's Slider class.
First you will need the slider class:

Here Link to Crash's Thread

Full credits to him for the Classes and how to use.

The Video:



The code:

I know this can be done other ways that are easier and smarter.
I chose to do it this way because it is very very very easy to understand.
There are also a lot of things you can do with this and the slider class so be creative

Code:
		if(curVal > -1)
		{
			DrawBox(50,400,100,20,White,White,pDevice);
			DrawString(50,400,Black,"0%");
		} 
		if(curVal > 20){
			DrawBox(50,400,20,20,Green,White,pDevice); 
			DrawString(50,400,Black,"20%");
		}
		if(curVal > 40){
			DrawBox(50,400,40,20,Green,White,pDevice);
			DrawString(50,400,Black,"40%");
		}
		if(curVal > 60){
			DrawBox(50,400,60,20,Green,White,pDevice);
			DrawString(50,400,Black,"60%");
		}
		if(curVal > 80){
			DrawBox(50,400,80,20,Green,White,pDevice);
			DrawString(50,400,Black,"80%");
		}
		if(curVal > 99){
			DrawBox(50,400,100,20,Green,White,pDevice);
			DrawString(50,400,Black,"100%");
		}
Of course if you change the minimum Value and maximum Value you must change the width on here so it corresponds to your slider.

I did curVal > -1 Because that will just draw initial box when the Value of the slider is greater than -1.

No questions unless it is necessary?

LOL

Credits: Crash, Functions in his thread(Draw box, etc...) Whoever?

KTHXBAII!
looks nice
but there are a lot of other ways to make the progress bar to fill exactly with slider value

edit why don't you make it an else if or case?
cause with the > you are drawing 5 boxes when you reach 100%
Quote Originally Posted by GodHack2 View Post
looks nice
but there are a lot of other ways to make the progress bar to fill exactly with slider value
I know like I said easy for noobs like me to understand and everyone else.. even pros can use this: )

Quote Originally Posted by GodHack2 View Post
looks nice
but there are a lot of other ways to make the progress bar to fill exactly with slider value

edit why don't you make it an else if or case?
cause with the > you are drawing 5 boxes when you reach 100%
I KNOW IT IS!

http://www.mpgh.net/forum/207-combat...ml#post3336482
http://www.mpgh.net/forum/207-combat...ml#post3336482
http://www.mpgh.net/forum/207-combat...ml#post3336482
http://www.mpgh.net/forum/207-combat...ml#post3336482
http://www.mpgh.net/forum/207-combat...ml#post3336482

http://www.mpgh.net/forum/207-combat...ml#post3336482
http://www.mpgh.net/forum/207-combat...ml#post3336482
http://www.mpgh.net/forum/207-combat...ml#post3336482
Your code in 1/5th the size
Code:
string str = atoi(curVal,buf,10);
str += "%"
DrawBox(50,400,curVal,20,Green,White,pDevice);
DrawString(50,400,Black,str.c_str());
Isn't the point of a progress bar to show progress in something like loader resources ?
Quote Originally Posted by Crash View Post
Isn't the point of a progress bar to show progress in something like loader resources ?
Exactly. Would be kinda useless because should really be loading anything that would take more than 3 seconds.
Quote Originally Posted by whatup777 View Post


Exactly. Would be kinda useless because should really be loading anything that would take more than 3 seconds.
I'm sure the same technique can be used for something like a health bar even if it doesn't show up as an actual progress bar. I think it it's a good contribution. Good to see people working on stuff and using Crash's classes.
Quote Originally Posted by why06 View Post


I'm sure the same technique can be used for something like a health bar even if it doesn't show up as an actual progress bar. I think it it's a good contribution. Good to see people working on stuff and using Crash's classes.
Where are your DClasses
Quote Originally Posted by Crash View Post
Where are your DClasses
Hidden in a section nobody visits.
Quote Originally Posted by why06 View Post
Your code in 1/5th the size
Code:
string str = atoi(curVal,buf,10);
str += "%"
DrawBox(50,400,curVal,20,Green,White,pDevice);
DrawString(50,400,Black,str.c_str());
hehe like i said.. be creative.
that is small and easy to understand.
well for me.

Quote Originally Posted by Crash View Post
Isn't the point of a progress bar to show progress in something like loader resources ?
Yeah you can load hacks, text, menus, such

Quote Originally Posted by whatup777 View Post


Exactly. Would be kinda useless because should really be loading anything that would take more than 3 seconds.
No. not really

Quote Originally Posted by why06 View Post


I'm sure the same technique can be used for something like a health bar even if it doesn't show up as an actual progress bar. I think it it's a good contribution. Good to see people working on stuff and using Crash's classes.
Thanks

Quote Originally Posted by Crash View Post
Where are your DClasses
In his school -.- what kind of dumb question is that coming from a smart person
Quote Originally Posted by Nubzgetkillz View Post
In his school -.- what kind of dumb question is that coming from a smart person
Classes like DPrint

msdfsdfasdffher23413412
Quote Originally Posted by why06 View Post


Hidden in a section nobody visits.
Trying my best to get that section active..
Quote Originally Posted by whit View Post


Trying my best to get that section active..
I don't think MPGH supports necromancy.
Quote Originally Posted by Crash View Post


I see those recently and like 5 other DPrint threads

WHER DAT SECRET SECTION.
Lol I made crash come out of his cave to go look for stuff

Quote Originally Posted by why06 View Post


I don't think MPGH supports necromancy.
LOL YES IT DOES


I see those recently and like 5 other DPrint threads

WHER DAT SECRET SECTION.
Posts 1–15 of 28 · Page 1 of 2
This thread is closed for replies.

Tags for this Thread

None

Talk with us