Texture Progress bar without clipping the texture

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sebkolind

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?

:bust_in_silhouette: Reply From: skysphr

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.

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.

sebkolind | 2022-02-08 19:21