0 votes

Hi. I am trying to make a Texture Progress bar where 10 health = 10 x the texture I have set as "progress texture". Is that possible?

Godot version 3.4.2
in Engine by (15 points)

1 Answer

0 votes
Best answer

If you mean you want your texture to tile instead of stretch when enabling nine_patch_stretch, it is not currently possible, although a proposal regarding this has been opened. You can however implement the mechanic yourself by using a TextureRect (or three, if you need under and over textures), enabling expand, setting its stretch mode to "Tile", and modifying its margins to fit the progress bar's values whenever required.

by (1,261 points)
selected by

Thank you very much! I used a TextureRect, and set it up as you said, and then increased the x size as need be. My graphic is 16x16px so increasing the x size by 16 for each health does the trick.

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.