Posted April 11, 201312 yr I would like to see the a RenderHUDEvent that allows you to draw on the players in-game screen. I know there are methods which makes this possible but once you open a GUI it renders over that GUI as well. With a RenderHUDEvent your renders will render behind Gui's. See code below for implementation. package net.minecraftforge.client.event; import net.minecraft.client.Minecraft; import net.minecraftforge.event.Event; public class RenderHUDEvent extends Event { public final Minecraft mc; public final float partialTick; public final boolean guiOpen; public final int mouseX; public final int mouseY; public RenderHUDEvent(Minecraft mc, float partialTick, boolean guiOpen, int mouseX, int mouseY) { this.mc = mc; this.partialTick = partialTick; this.guiOpen = guiOpen; this.mouseX = mouseX; this.mouseY = mouseY; } } GuiIngame.java if (this.mc.playerController.func_78763_f() && this.mc.thePlayer.experienceLevel > 0) { this.mc.mcProfiler.startSection("expLevel"); flag1 = false; i1 = flag1 ? 16777215 : 8453920; String s = "" + this.mc.thePlayer.experienceLevel; j5 = (k - fontrenderer.getStringWidth(s)) / 2; k5 = l - 31 - 4; fontrenderer.drawString(s, j5 + 1, k5, 0); fontrenderer.drawString(s, j5 - 1, k5, 0); fontrenderer.drawString(s, j5, k5 + 1, 0); fontrenderer.drawString(s, j5, k5 - 1, 0); fontrenderer.drawString(s, j5, k5, i1); this.mc.mcProfiler.endSection(); } MinecraftForge.EVENT_BUS.post(new RenderHUDEvent(this.mc, par1, par2, par3, par4)); String s1; if (this.mc.gameSettings.heldItemTooltips) { this.mc.mcProfiler.startSection("toolHighlight"); if (this.field_92017_k > 0 && this.field_92016_l != null) { With use of Render Tick: With use of RenderHUDEvent:
April 11, 201312 yr Just draw your stuff using a tick handler and the Tesselator. If you don't want it to draw over other Guis, check for this before drawing. FMLClientHandler.instance().getClient().inGameHasFocus If that returns false, don't draw your stuff. Simple.
April 11, 201312 yr Author I tried pretty much everything to draw behind gui, but never got the right result.
April 16, 201312 yr Author Okay here are some pictures of what I mean with my "problem" With use of Render Tick: With use of RenderHUDEvent:
April 16, 201312 yr Author Okay here are some pictures of what I mean with my "problem" With use of Render Tick: With use of RenderHUDEvent:
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.