Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed

    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!
    Last edited by Nubzgetkillz; 01-18-2011 at 07:15 PM.

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  2. The Following 2 Users Say Thank You to Nubzgetkillz For This Useful Post:

    -xGhost- (01-18-2011),why06 (01-18-2011)

  3. #2
    GodHack2's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    645
    Reputation
    38
    Thanks
    762
    My Mood
    Amused
    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%
    Last edited by GodHack2; 01-18-2011 at 07:22 PM.





    beat this bitches ^^^^^^^

    Current Stats : Bored :/


    Respect list :
    Crash !
    Gordon'
    Markoj

  4. #3
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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
    Last edited by Nubzgetkillz; 01-18-2011 at 07:24 PM.

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  5. #4
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,305
    Reputation
    170
    Thanks
    2,194
    My Mood
    Flirty
    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());
    Last edited by why06; 01-18-2011 at 07:39 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. #5
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Isn't the point of a progress bar to show progress in something like loader resources ?

  7. #6
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    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.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  8. #7
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,305
    Reputation
    170
    Thanks
    2,194
    My Mood
    Flirty
    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.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  9. #8
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    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

  10. #9
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,305
    Reputation
    170
    Thanks
    2,194
    My Mood
    Flirty
    Quote Originally Posted by Crash View Post
    Where are your DClasses
    Hidden in a section nobody visits.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  11. #10
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  12. #11
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    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

  13. #12
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,170
    Reputation
    490
    Thanks
    2,252
    Quote Originally Posted by why06 View Post


    Hidden in a section nobody visits.
    Trying my best to get that section active..

  14. #13
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy


    I see those recently and like 5 other DPrint threads

    WHER DAT SECRET SECTION.

  15. #14
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,305
    Reputation
    170
    Thanks
    2,194
    My Mood
    Flirty
    Quote Originally Posted by whit View Post


    Trying my best to get that section active..
    I don't think MPGH supports necromancy.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  16. #15
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

Page 1 of 2 12 LastLast