Posted March 11, 20214 yr Hello. I want to render a small texture for a HUD. I currently have this for testing prupose: @SubscribeEvent public static void displayData(RenderGameOverlayEvent.Post event) { if(event.getType().equals(RenderGameOverlayEvent.ElementType.ALL)) { Minecraft mc = Minecraft.getInstance(); MatrixStack matrixStack = event.getMatrixStack(); mc.getTextureManager().bindTexture(new ResourceLocation("elementalcombat", "textures/icons/fire.png")); matrixStack.push(); matrixStack.scale(0.1F, 0.1F, 0.1F); mc.ingameGUI.blit(matrixStack, 0, 0, 0, 0, 256, 256); matrixStack.pop(); mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION); } } The image gets rendered, but I have few issues. 1. If I don't scale the matrixstack, the image is gigantic and takes up the full left side of the screen. 2. If I don't set the uWidth or vHeight to 256, only parts of the texture gets rendered. This is weird, cause the sprite has the size of 7x7 px. Why is the sprite ingame so gigantic and also exceed the 7x7 size? If I change my ResourceLocation to GUI_ICONS_LOCATION and disable the scaling, the rendered sprite has the normal size, that I would expect from it.
March 11, 20214 yr Author Ah okay. I knew, it must be something simple, that I overlooked. Texture will be changed anyway. I just threw some stuff together, but thanks for the heads up anyway.
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.