Hello everybody,
i need your help. I render a custom screen in Minecraft with the RenderGameOverlayEvent, but the Armor Bar and Food Bar lose their texture coordinates.
Is that a bug or am I doing something wrong?
Event-Handler:
@Mod.EventBusSubscriber
public class GuiEvents
{
@SubscribeEvent
public static void renderGUI(RenderGameOverlayEvent.Post event)
{
new PlayerDataScreen(Minecraft.getInstance(), event.getMatrixStack());
}
}
Screen:
public class PlayerDataScreen extends IngameGui
{
public PlayerDataScreen(Minecraft mcIn, MatrixStack matrixStack)
{
super(mcIn);
StringTextComponent textComponent = new StringTextComponent("");
textComponent.func_240699_a_(TextFormatting.GOLD);
textComponent.func_230529_a_(new StringTextComponent(",").func_240699_a_(TextFormatting.WHITE));
textComponent.func_230529_a_(new StringTextComponent("").func_240699_a_(TextFormatting.DARK_GRAY));
textComponent.func_230529_a_(new StringTextComponent(",").func_240699_a_(TextFormatting.WHITE));
textComponent.func_230529_a_(new StringTextComponent("").func_240699_a_(TextFormatting.DARK_RED));
this.getFontRenderer().func_243246_a(matrixStack, textComponent, 15,15, 16);
}
}
Result: