Jump to content

Recommended Posts

Posted

Hey,

I've been trying to make a bar for my tileEntity, which shows the energy storage percentage. I have seen that the Vanilla screens are using the blit() function to do this. Can someone explain me what exactly it does and what parameters i need.

Thank you!

Posted

There are a couple, but the most used one in screens is the none static one that takes matrixstack, xpos, ypos, upos, vpos, uwidth, vheight.

 

E.g. blit(stack, 10, 10, 1, 1, 15, 15)

This will draw texture at (10, 10) on the screen with the texture position at (1, 1) to (16, 16), note that this one only accepts texture size of 256*256.

Before drawing you need to bind the texture using TextureManager.bindTexture, the instance of the manager can be obtained from Minecraft.

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.

Announcements



×
×
  • Create New...

Important Information

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