Posted June 26, 201510 yr Ok i want to hit like the "u" key and a small little window with grey background and some text to pop up, ive followed any tutorials but none really helped for 1.8, i was wondering if someone can maybe point me in the right direction?
June 27, 201510 yr Ok i want to hit like the "u" key and a small little window with grey background and some text to pop up, ive followed any tutorials but none really helped for 1.8, i was wondering if someone can maybe point me in the right direction? This is really easy. Do a GuyOverlay that only displays a grey/textured rectangle when the 'u' key is pressed. I did it like this and it works great. To get a GuyOverlay working, youll have to creat a new class that has the following few things in it: public class YourOverlay extends Gui{ public YOurOverlay(Minecraft mc){ this.mc = mc; } @SubscribeEvent(priority = EventPriority.NORMAL) public void renderOverlay(RenderGameOverlayEvent event){ ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); int k = scaledresolution.getScaledWidth(); int l = scaledresolution.getScaledHeight(); if (event.type != ElementType.ALL) { return; } if (Keyboard.isKeyDown(Keyboard.KEY_U)){ GL11.glPushMatrix(); //Your code here (Youll have to use k as width and l as height!!) GL11.glPopMatrix(); } } } Then youll have to define a new field in your ClientProxy and register the YourOverlay-class like this in your ClientProxy : private final Minecraft mc = Minecraft.getMinecraft(); MinecraftForge.EVENT_BUS.register(new YourOverlay(mc));
June 27, 201510 yr Please don't hardcode keys. Use a keybinding so people can change them. Yea could've done that thank you
June 28, 201510 yr Author Ok i want to hit like the "u" key and a small little window with grey background and some text to pop up, ive followed any tutorials but none really helped for 1.8, i was wondering if someone can maybe point me in the right direction? This is really easy. Do a GuyOverlay that only displays a grey/textured rectangle when the 'u' key is pressed. I did it like this and it works great. To get a GuyOverlay working, youll have to creat a new class that has the following few things in it: public class YourOverlay extends Gui{ public YOurOverlay(Minecraft mc){ this.mc = mc; } @SubscribeEvent(priority = EventPriority.NORMAL) public void renderOverlay(RenderGameOverlayEvent event){ ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); int k = scaledresolution.getScaledWidth(); int l = scaledresolution.getScaledHeight(); if (event.type != ElementType.ALL) { return; } if (Keyboard.isKeyDown(Keyboard.KEY_U)){ GL11.glPushMatrix(); //Your code here (Youll have to use k as width and l as height!!) GL11.glPopMatrix(); } } } Then youll have to define a new field in your ClientProxy and register the YourOverlay-class like this in your ClientProxy : private final Minecraft mc = Minecraft.getMinecraft(); MinecraftForge.EVENT_BUS.register(new YourOverlay(mc)); How do i setup a client proxie?
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.