changing overlay length

Started by LOLLYBYE on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
changing overlay length
Sun, 12/10/2023 - 01:07 (edited)

I created an overlay for a custom health bar, you can see it on the screenshot. When the character's health changes, the length of the overlay changes. For this I use a variable "barlength". But there is a problem: the health scale goes from bottom to top, but I need it from top to bottom. I think that the problem can be easily solved, but I still haven’t found a solution using brute-force methods, I hope you can help. I am attaching a screenshot and lines of code.

https://drive.google.com/file/d/1Up2Bd4laI1ZB5TFyGuyyHT5fw1gvxKLK/view?…

Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("custombar:textures/screens/bar.png")); Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX, posY + -56, 0, 0, 64, barlength, 64, 64); 

 

 

 

Edited by LOLLYBYE on Sun, 12/10/2023 - 01:07