Can someone suggest me a way to crop vertical HP bar? I can just make 100 images, +1% each step. And load it every time hp changes. But I’m sure there is a way to crop it using code only. So my game will be working faster.
I will use just an image, feels easier for me. That’s why I need to know whether there is a way to crop images. And then I will just change the value to crop it by the amount of missing health.
There may well be a way to crop it nowadays, but the old school way would be to either resize the image, or to have a second image that is just the background colour on top of it, and resize that. Resizing an image is simple, you can just set “width” or “height”. The initial positioning can be challenging.
I have not done much JavaScript with Twine, so cannot say more than that.