Jump to content

Recommended Posts

Posted (edited)

Hi,

 

I have some code to add a HUD to the game containing FPS/Watermark/Coordinates etc, however when in survival mode it will break the health bar image. 

image.thumb.png.aecc3cfbe55f9d59168a4e49de534c90.png

The GUI is fine after the boxes are drawn, but after the string is added the inventory breaks.

 

Code: 

	@SubscribeEvent
	public void onRender(RenderGameOverlayEvent event) {
		Color Aqua = new Color(0, 255, 255, 175); //WaterMark Blue Box
		drawRect(2, 16, 64, 1, Aqua.getRGB());
		drawRect(3, 15, 63, 2, BlackColor.getRGB()); //WaterMark Black Box	
		mc.fontRendererObj.drawString(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "Water" + EnumChatFormatting.GRAY + "" + EnumChatFormatting.BOLD + "MA" + EnumChatFormatting.WHITE + "RK" + EnumChatFormatting.BOLD + "us", 6, 5, Integer.parseInt("000000", 16));
	}

Any help is greatly appreciated, thank you.

 

UPDATE: changing the event to RenderGameOverlayEvent.post solves the health bar, but the armour is still broken.

UPDATE 2: change to text and works fine. solved

Edited by OnePound
partial solution found
Posted

To the surprise of no one (if you think about it for more than fifteen seconds):

Drawing text binds a different texture to the the drawing functions in OpenGL than the hud icons use.

 

And you aren't changing it back.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.