Post: Hud Element Help?
12-15-2015, 06:31 PM #1
gοd
Vault dweller
(adsbygoogle = window.adsbygoogle || []).push({});
Yo NGU,
Latley i have been thinking about making a menu for a game but i need to get the Hud Element!


But i am not sure on how i would find the Hud Element or go along creating it??

If anyone can help i would be appreciated <3
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked gοd for this useful post:

Robert123
12-15-2015, 08:27 PM #2
Dan
I'm a god.
Originally posted by Chris
Yo NGU,
Latley i have been thinking about making a menu for a game but i need to get the Hud Element!


But i am not sure on how i would find the Hud Element or go along creating it??

If anyone can help i would be appreciated <3


For what game?
12-15-2015, 09:23 PM #3
gοd
Vault dweller
Originally posted by Dan View Post
For what game?


Minecraft xD
12-15-2015, 09:27 PM #4
Dan
I'm a god.
Originally posted by Chris
Minecraft xD


Originally posted by another user
I made my HUD by setting up a Tick Handler on Client Side. Then in the tickEnd() method I'm checking if the TickType is type of TickType.RENDER and do my render stuff there. To access the HUD I check if the current gui screen is null (IngameGUI), cast the current ingame GUI to an object of GuiIngame and do my render stuff in there. So all in all your HUD class should look like this:


    
public class HUDHandler implements ITickHandler {

@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {

}

@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
if (type.equals(EnumSet.of(TickType.RENDER))) {
Minecraft mc = Minecraft.getMinecraft();

if (mc.currentScreen == null) {
GuiIngame gig = new GuiIngame(mc);
// Do your render stuff here
}
}
}


@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.CLIENT, TickType.RENDER); // Check whether client or render
}

@Override
public String getLabel() {
return "YourLabelHere";
}


Originally posted by another user
Don't forget to register the TickHandler in the TickRegistry
12-16-2015, 10:44 AM #5
gοd
Vault dweller
Originally posted by Dan View Post
    
public class HUDHandler implements ITickHandler {

@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {

}

@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
if (type.equals(EnumSet.of(TickType.RENDER))) {
Minecraft mc = Minecraft.getMinecraft();

if (mc.currentScreen == null) {
GuiIngame gig = new GuiIngame(mc);
// Do your render stuff here
}
}
}


@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.CLIENT, TickType.RENDER); // Check whether client or render
}

@Override
public String getLabel() {
return "YourLabelHere";
}


Ill give it a try when I get home later

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo