Posted July 23, 20196 yr I'm trying to add on to existing GUI's via the GuiContainerEvent.DrawForeground event. Previously, I was doing the following: mc.getTextureManager().bindTexture(searchBar); Gui.drawTexturedModalRect(79, 4, 0, 0, 90, 12); However, with 1.14, it seems the correct syntax would be: GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(searchBar); event.getGuiContainer().blit(79, 4, 0, 0, 90, 12); The issue I'm encountering is that this new function does not seem to correctly render my texture. Linked is an imgur album with comparisons of what the texture is and what will be rendered. The texture is 90x12 pixels in all examples. I am confident the ResourceLocation is correct given that the texture clearly changes when the image is changed, but is still displayed incorrectly. Is it possible the parameter order has switched and I didn't realize it? Any advice is appreciated.
July 25, 20196 yr RIGHT?! Please let me know as I to have a Post up about this...the only way i was able to get mine to work was by making it 256 * 256 which is counter countuitive
July 26, 20196 yr 4 hours ago, cleardragonf said: RIGHT?! Please let me know as I to have a Post up about this...the only way i was able to get mine to work was by making it 256 * 256 which is counter countuitive This is the way it was expected to be in older versions too, but you didnt have to use the method that required it to be 256x256. You'll notice that all Minecraft gui assets are 256x256. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 26, 20196 yr yea...i notice that...but ContainerScreen in 1.14.3 functions the way most people are use to...ie custom size capabilities...
July 26, 20196 yr 45 minutes ago, cleardragonf said: yea...i notice that...but ContainerScreen in 1.14.3 functions the way most people are use to...ie custom size capabilities... Yeah there are now many methods with different parameters. Could have been that those methods hadn't been mapped. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 28, 20196 yr just a heads up....found a way around the overlay issue. if you want... public class customGUI { public static final Minecraft mc = Minecraft.getInstance(); public static void drawModalRectWithCustomSizedTexture(double leftSideX, double rightSideX, double bottomY, double topY, ResourceLocation texture) { GlStateManager.disableDepthTest(); GlStateManager.depthMask(false); GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableAlphaTest(); mc.getTextureManager().bindTexture(texture); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); //botlef bufferbuilder.pos(0.0D, (double)mc.mainWindow.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex(); bufferbuilder.pos(leftSideX, bottomY, -90.0D).tex(0.0D, 1.0D).endVertex(); //botr bufferbuilder.pos((double)mc.mainWindow.getScaledWidth(), (double)mc.mainWindow.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex(); bufferbuilder.pos(rightSideX, bottomY, -90.0D).tex(1.0D, 1.0D).endVertex(); //topr bufferbuilder.pos((double)mc.mainWindow.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex(); bufferbuilder.pos(rightSideX, topY, -90.0D).tex(1.0D, 0.0D).endVertex(); //topl bufferbuilder.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex(); bufferbuilder.pos(leftSideX, topY, -90.0D).tex(0.0D, 0.0D).endVertex(); tessellator.draw(); GlStateManager.depthMask(true); GlStateManager.enableDepthTest(); GlStateManager.enableAlphaTest(); GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); } } make this a class...then call it from where ever you want...works for me on a 128 *29 image.
April 9, 20205 yr I had to add RenderSystem.enableBlend() to get the transparency of the texture to work I'm using Forge for 1.15.
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.