Modifying health bar length

zexika

Member
Original:
Good evening everyone! I am tinkering with levels.txt and I've already figured out how to place the player health bar where I want on the screen, but am curious as to how to actually modify the length and size of it. I want to make the bar smaller, any thoughts on which file modifies that feature?


EDIT: In most forums, I've noticed OP's who find a solution to their problems and don't normally post their solution, I'm not about to contribute to that trend, so I'm modifying this post into a quick guide with a solution. I realized the levels.txt file was missing the commands altogether. I've added them below:

#-------Lifebar settings
lbarsize 71 5 1 1 0
mpbarsize 71 5 1 0 0

Quick Guide:  lbarsize is our example.
71 Represents the horizontal length of the bar.
5 Represents the thickness of the bar vertically
Leave 1, 1, and 0 alone. I've played around with these and they either do nothing, or make the HP bar disappear altogether.
 
Those other parameters are for setting different types of lifebars. From the manual:

lbarsize {w} {h} {noborder} {type} {orientation} {border} {shadow} {graph} {backfill}

    Controls the size of lifebars.
    This applies to players, enemies, items, etc (their lifebar will all have the same width, height, etc). If 'olbarsize' is declared, this only applies to players.
    {w} is the maximum amount of health the bar can display. Defaults to 100.
    {h} is the height of the lifebar in pixels. Defaults to 5.
    {noborder} turns on or off the border and shadow around life bars. {0} means there is, {1} means no outline or shadow.
    {type} is a flag that sets how lifebar show health. 0 (default) means if an entity's health goes over width, the life bar will wrap around and 'double up' on top of itself (1 unit of health is 1 pixel long.). 1 shows % of max health (bar is full at 100%, half filled at 50%, etc.).
    {orientation} is a flag that sets lifebar's orientation.
        0 (default) = horizontal orientation. Lifebar is filled from left to right in this mode.
        1 = vertical orientation. Lifebar is filled from down to up in this mode.
    {border} sets layer adjustment of outer border. Default to 0.
    {shadow} sets layer adjustment of border shadow. Default to 0.
    {graph} sets layer adjustment of graph fill. Default to 0.
    {backfill} sets layer adjustment graph background. Default to 0.
    The last 4 variables can be used to place lifebar behind player 'icon' or 'bgicon'. To do that you need to give value like -300.
 
Back
Top Bottom