Converting HP bar to percentage

jsomr

Veteran
Veteran
Joined
Nov 22, 2014
Messages
30
Reaction score
0
First Language
English
Primarily Uses
Instead of showing 3000/3000 HP with a bar I'd like to show a percentage only (1-100%).
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What if we've never played Halo?


If you need this to be done with, or to work with, another script, please provide a link to the script (that does not mean copying and pasting the script into your post).
 

Mr. Trivel

Glasses
Veteran
Joined
Jun 9, 2014
Messages
284
Reaction score
469
First Language
Lithuanian
Primarily Uses
class Window_Base < Window #-------------------------------------------------------------------------- # * Draw HP #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 124) change_color(normal_color) draw_text(x, y, width, line_height, "#{(actor.hp_rate * 100).to_i}%", 2) endendLike that?
 

jsomr

Veteran
Veteran
Joined
Nov 22, 2014
Messages
30
Reaction score
0
First Language
English
Primarily Uses
class Window_Base < Window #-------------------------------------------------------------------------- # * Draw HP #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 124) change_color(normal_color) draw_text(x, y, width, line_height, "#{(actor.hp_rate * 100).to_i}%", 2) endendLike that?
I kind of love you.

This is somewhat unrelated but using that script can you have HP regenerate when out of combat? Say 6% every second?
 
Last edited by a moderator:

jsomr

Veteran
Veteran
Joined
Nov 22, 2014
Messages
30
Reaction score
0
First Language
English
Primarily Uses
How would I go about showing HP as a percentage in the field?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top