Can I treat resource bar variants like sprite animations

So I’m using a built in resource bar and I want the resource bar when it reach 33%. Is there any way I can set the bar to red similar to how I would change an animation? I also tried to use tween by rgb/color but it wasn’t working.

*I want the resource bar to turn red when it reaches 33%

You can go inside the resource bar extension.
All of this must be written in a function that always repeats.
Instructions:

  1. Make the bar white (in piskel)
  2. If the value is 33, change the color to red
  3. If the value is not 33, change the color to another color
1 Like

I’m having trouble finding the functions/events section for the resource bar. Ok I found it.

Unless you just change the image, the downside of modifing a resource bar is that you’ll lose you’re changes if GD upgrades the object.

Resources bars are simple to make. You could use a sprite, change it’s width and then either change the tint of a white image or use different animations.

Width= Value / MaxValue * MaxWidth

I used a slider for the testing.

I used 3 colors just for an example of using 3.

1 Like

Thanks for this I’ve considered just creating my own health bar, but the bar kept moving out of place, and shrinking, and displayed only negative numbers, so I gave up and disabled it but I think I will give it another try.

1 Like

If it moves then it’s probably the object points. It grows and shrinks based on the points. Move the origin to the left edge. You may need to also use the center point to the edge as well depending on your project.

If it expands or shrinks too much you can use clamp() or min() or max()