Posted March 27, 20169 yr Hello! Following tidbits of tutorials, I've managed to come up with a very small GUI class. I can open it, but can't render anything on it. The only thing that makes any difference is this.drawDefaultBackground(). I am showing the GUI with "Minecraft.getMinecraft().displayGUIScreen(new MyGuiClass());". The GUI class: Minecraft mc = Minecraft.getMinecraft(); public static final int GUI_ID = 20; @Override public void drawScreen(int mouseX, int mouseY, float partialTicks){ this.drawDefaultBackground(); this.buttonList.add(new GuiButton(1, 50, 50, 10, 10, "Hi")); } @Override public void initGui(){ super.initGui(); this.buttonList.add(new GuiButton(1, 50, 50, 10, 10, "Hi")); } The button does not load, and I do not get any errors. I put it on both initGui and drawScreen for testing purposes, probably not the best idea.
March 27, 20169 yr Author Indeed that is not a good idea. Only add buttons in initGui. You must call super.drawScreen as that is where the button drawing happens. Thank you, I just realized this before I saw your post.
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.