0 votes

I'm working on a simple 2d game and trying to show player health on a radial, donut-shaped indicator. If you've played Breath of the WIld, picture the stamina wheel.

The player health wheel should be full until they start taking damage, then it should decrease at a steady pace till they get out of the danger area (I have collision and areas with signals handling this.) Once they're out, it'll refill (again, at a steady pace, but probably a different speed) -- till it's back to 100%;

I think I have a general sense of the math/logic for this, but how would I translate these interpolating numbers into a wheel? Where at 100% you see the whole wheel, at 50% half of it is masked/gone, et cetera.

Is there a control node that's well suited to this or is this a case for custom drawing?

in Engine by (332 points)

Have you looked into a TextureProgress node? It can be filled radially (see the radial_* properties for more details).

Perfect! I forgot this node existed and it's exactly what I need. Thanks for the tip.

1 Answer

0 votes

If you want it to appear identical to your reference example you'll probably need to create a pixel shader for it.

If you are just talking about a round health bar, you can make one of those easily enough with various images depending on how many hit points you want the character to have. Or with an animated sprite.

by (856 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.