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

Im making a mod that is supposed to draw text on the screen, I'm doing this by creating a GUI and rendering it on the RenderGameOverlay event like this

@SubscribeEvent
    public void onRenderGui(RenderGameOverlayEvent event) {
	new ModList(Minecraft.getMinecraft());
}

and

public class ModList extends Gui{

public ModList(Minecraft mc) {
	drawString(mc.fontRendererObj, "Test", 10, 10, 16755200);
}
}

The problem I am having at the moment is that when I draw the string for some reason it draws the text twice like in this image

http://imgur.com/dF2vsuZ

 

Does anyone know why this is occurring?

  • Author

hmm i managed to fix my own problem by instead of using the RenderGameOverlay event use RenderGameOverlay.Text i don't understand why this changed anything but it works... i guess

hmm i managed to fix my own problem by instead of using the RenderGameOverlay event use RenderGameOverlay.Text i don't understand why this changed anything but it works... i guess

Because there are multiple RenderGameOverlay sub events, and how event buses work. When you subscribe to RenderGameOverlay, you will recieve all events that are child classes of RenderGameOverlay. So you are rendering your text for each element of hud rendered.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.