Forum

> > CS2D > Scripts > Advanced Heath bar
Forums overviewCS2D overview Scripts overviewLog in to reply

English Advanced Heath bar

9 replies
To the start Previous 1 Next To the start

old Re: Advanced Heath bar

Rainoth
Moderator Off Offline

Quote
The concept is simple. You draw a line horizontally and it's width just changes based on your health.

old Re: Advanced Heath bar

RIP-HereRestsPlookerbooy
BANNED Off Offline

Quote
No no no, Itsn't like that, I want to make a HP bar just like in the first picture, 100% identical. I already edited Alistaire Gore Extension to get the Health bar script from it but I want to make one with shadowing and with a layer just like the pictures...

old Re: Advanced Heath bar

Mora
User Off Offline

Quote
Idk which maxhealth do you use, but:
1
2
3
4
5
6
7
8
Max = player(id,'maxhealth')
CurrentHP = player(id,'health')
CurrentDel = Max/CurrentHP
ImageScale=100/CurrentDel

imagescale(img,200/CurrentDel,4)
	
imagepos(img,66+(200/CurrentDel)/2),128,0)
Where img is that 1x1 image.

The same you can change
Max to
Max = maxvalue

and
CurrentHP = value

To make it identical like first one you could use first image:
just 1x1. to scale it,
image which will fill by that 1x1.
Or you could make 2x image of your full health bar:
___50%empty____|____50%image___
So when you'll scale that you don't need much calculations.(i guess.. anyway never used such like that)

old Re: Advanced Heath bar

RIP-HereRestsPlookerbooy
BANNED Off Offline

Quote
user Mora If I made a script using the second one, I'll be able to use it forever.. I can color it, scale it and such..
and sadly the first picture is from a game named WoW If you know it..

old Re: Advanced Heath bar

Mora
User Off Offline

Quote
Why sadly?
You can make your own hud.-. isn't that so hard.
All you need is just add some shadow, or shine transparented on your image, then under the image you scale the one which used as bar.

old Re: Advanced Heath bar

RIP-HereRestsPlookerbooy
BANNED Off Offline

Quote
user Mora:If it was that easy, I would've already done that. Can't you see? That HP bar isn't on a straight line.. there are few cuts(I don't know the word) on the corners
edited 1×, last 20.01.17 05:44:52 pm

old Re: Advanced Heath bar

Mora
User Off Offline

Quote
Hmm. ye. but you'll leave it as it stay, after your image would be scaled enough(out of borders) it will fill it and the edges still here.
Idk another way than use image with frames.. or adding +one image on the edge of the scaled one, when set it's size -2(to make free space for them) from both sides.

old Re: Advanced Heath bar

Zeik
User Off Offline

Quote
If there is no way to add images in different layers in the HUD (which I think you can't), then there's no easy way to do it. If there is, then you can use an empty bar with shadows, and below it the green bar. Otherwise I think it's not worth the trouble.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview