How do I Set HealthBarFX

0 favourites
• 10 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
• how to set value HealthBarFX from Player.HP per %

if my Player.HP = 400 set Value HealthBarFX #!@? what math need

i cant find post about setup HealhBarFX

link post or Capx are welcome <3

• HealthBarFX > Set width to Player.HP*.25

You need to find the right number to multiply against (*.25) versus 100% of the HealthBarFX size, which depends on the amount Player.HP.

In the above example (*.25) is 25% of the Value. You have to play with the values but, multiplying times a decimal value is how you obtain or set by percentage.

• TheDom can you make example with capx please ? <3

my player hp change all time

and i dont have only one player is multiplay with defernce value HP

• if you want set hpbarfx to Player.hp

you should add to player container this hpbar

(you find container in sprite properties)

set width to: (hp/hpmax)*220 (220 this is pixel width)

when hp is full, your bar will have 220 px width

when hp i 1/2 your hpbar width will be 110

if you have only one variable 'HP'

set width to HP

(but when your hp will be 9999 your hp bar will have 9999px

so you can always add '/2' after set width to HP/2

but this trick with width he make the bar health longer or smaller

i dont need that!! i want standar width with the HPBar..

if some one have 450.000 HP tha hpbar gonna run out of layer? i dont think this is best way

• ok here is your lucky day

https://www.dropbox.com/s/kvlw55q55wbt3 ... .capx?dl=0

me and my friend made this hp bar

from green to red

using it in the game im curently developing

http://kiugetski.com/space

this hp bar work with any life value <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> using 2 varriables HP and MAXHP

• Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• kiugetski you are amazing <3

thank you very much, that's exactly i'm looking

• glad to have helped you out

• Thx this helped a lot

• kiugetski, excellent method with the variables, a really nice share, Thanks.

btw best of luck with your project.

• 10 posts