Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Xp bar help

Author
Message
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 13th Nov 2008 18:53
Wee, now I feel uneducated

I looked around and founds tons of things on how to make the bars (which I knew already so I'm glad people are as smart as me ) but nothing in the form of "growing experiance needed to level." What's a good math problem or sequence to illustrate gaining XP. Something continuously dividable by an even number would be nice (so the XP bar doesn't grow out of the box!!!) Can some one help?

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 13th Nov 2008 21:00
You just need to constrain it; let's say that exp holds the current value and nextLevel how much more experience points you need to level up.
Then you would draw your bar as:
lenght = int(((200.0 * exp) / nextLevel) + 0.50)
200 is the maximum length of the bar; + 0.50 is there so that int will round it correctly.


-> Oh, come on...
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 15th Nov 2008 09:03
okay now say I wanted to draw right to left, what's the reverse of this. (Because I tried to invert it and all I got was a swap in color )

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 15th Nov 2008 09:29
LMFAO NVR MIND THAT EXAMPLE OF HUMAN STUPIDITY please

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Login to post a reply

Server time is: 2024-11-24 16:58:02
Your offset time is: 2024-11-24 16:58:02