Jump to content

[SOLVED] [1.11] drawTexturedModalRect draws greyed out texture


Recommended Posts

I'm trying to display some additional texture near the tooltip, when player hovering an item in his iinventory:

    public static void beforeTooltipRender(RenderTooltipEvent.Pre event) {
        if (event.getStack().getItem() instanceof ItemSocketedArmor) {
            Minecraft mc = Minecraft.getMinecraft();
            int x = event.getX() - 20;
            int y = event.getY() - 20;
            mc.getTextureManager().bindTexture(new ResourceLocation(Runewords.MODID, "gui/sockets.png"));
            mc.currentScreen.drawTexturedModalRect(x + 2, y + 2, 0, 0, 16, 16);


sockets.png is 256*256, texture is in the top left corner, but in game it is much darker, than in file.

This is example with white texture (all file is just #fff):t.png.491f0cfc1b9d7170a410c9537863ec40.png

And one more moment: if I change filename, so the game cannot find it (and there is an exception about it in console), the mising texture square have veeery dark color instead of common purple.

Edited by TEXHIK
Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.