Jump to content

Recommended Posts

Posted

So i'm trying to display a small icon in a GUI (resolution 16x16) on the same size as the hearts of the health bar.

But using the Gl11.scalef() function also scales the infentory gui. What would be the proper way to do this?

 

GlStateManager.color(1, 1, 1, 1);
mc.getTextureManager().bindTexture(MANA_ICON);
GL11.glScalef(0.1f, 0.1f, 0.1f);
drawTexturedModalRect(30, 30, 0, 0, 256, 256);

 

Thanks in advance.

Posted (edited)

So normally when i position the sprite at 100, 100 its near the middle and if i scale it its almost in the corner.

 

GL11.glPushMatrix();
GlStateManager.color(1, 1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(MANA_ICON);
GL11.glScalef(0.06f, 0.06f, 0.06f);
drawTexturedModalRect(100, 100, 0, 0, 256, 256);
GL11.glPopMatrix();
Edited by BrainFace

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.

Guest
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.