M
MagnumVulcanos
Guest
So I have two sprites, one transparent outline of a heart and a red blob in the shape o the heart, when the first is put over the second and both get shown, what you get is a pretty nice effect of a red heart.
Now comes the part I don't know how to do:
When the health attribute is at 50% the sprite under the heart should only get it's bottom half rendered.
In other words, if I have 60 health out of 200, only the bottom 30% of the sprite should be drawn, assuming a sprite with 100 pixels of height, only 30 pixels from the bottom upwards should be drawn and the rest should be transparent or not drawn, in essence invisible.
The main problem comes from the fact that the heart is an irregular shape so scaling the sprite below (solid color) wouldn't work since you'd get what looks like an ugly deflated balloon instead of a bar of health that decreases.
Any help would be appreciated. I bought the humble bundle version of game maker studio if the version is important.
Now comes the part I don't know how to do:
When the health attribute is at 50% the sprite under the heart should only get it's bottom half rendered.
In other words, if I have 60 health out of 200, only the bottom 30% of the sprite should be drawn, assuming a sprite with 100 pixels of height, only 30 pixels from the bottom upwards should be drawn and the rest should be transparent or not drawn, in essence invisible.
The main problem comes from the fact that the heart is an irregular shape so scaling the sprite below (solid color) wouldn't work since you'd get what looks like an ugly deflated balloon instead of a bar of health that decreases.
Any help would be appreciated. I bought the humble bundle version of game maker studio if the version is important.