Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.