hello every one I'm finally getting back to making my CMS and I wanted to put bars in but I realized after looking at many examples that I don't know how they work
so I was wondering if any one could make a very simple example of a solid color bar that fills based on the % health/MP/EXP of the actor? and explain how it works? and if you feel you have the time explain it line by line?
http://forum.chaos-project.com/index.php?topic=22.0
I made an example in there. :3
odd... I was sure i'd read the thing quite throughly
any idea what section its in? that might help me find it.
Its in the section thats in bold.
5. Lag-weg
5.1. Algorithm Complexity
5.2. What lags and why it lags (RGSS specific)
5.3. Decrease Process Time
5.4. Don't fear more Code
5.5. RAM or CPU?
thanks Juan
ok I found the example but even reading the comments I still cant understand what "exactly" the script is doing. for example I know when it is drawing a rectangle that is "so big" by "so big" and is "such and such" color. and I understand when it is defining a color value to a a variable bu the rest is just a bunch of lines in the mud I TINHK I know what the purpose is but what it is doing and how it is doing it are beyond me.
so I think I should start simpler. can you make a code that draws a % bar that is one solid color not red on on side the transitioning to yellow?
Then just try something like:
rate = actor.hp * 100 / actor.maxhp
self.contents.fill_rect(x, y, rate * MAXWIDTH / 100, 12, Color.new(255, 255, 0))
instead of all the code there. Or simply only
self.contents.fill_rect(x, y, rate * w / 100, 12, Color.new(255, 255, 0))
if you are using that draw_bar method or however I called it.
:o wow now that is simple I understand that completly!
Oops! If you use my method, you need this here. xD
self.contents.fill_rect(x, y, rate * w, 12, Color.new(255, 255, 0))
My bad. xD