Jump to content

[1.7.10] Render dynamic text in TESR


XFactHD

Recommended Posts

I want to make an energy meter where you can read the data without opening a GUI. I tried it with the FontRenderer but I can't use it because it only has x and y coordinates and I need a z coordinate too. I didn't really try using the tesselator because I have problems understanding that thing. Is there any other way of doing this?

Link to comment
Share on other sites

I don't think there is any easier/nicer way to do it. You most certainly want to use FontRenderer and to do that you need something to draw on - plane.

 

GL11.glTranslatef((float) (x - Minecraft#getRenderManager().viewerPosX), (float) (y - Minecraft#getRenderManager().viewerPosYt), (float) (z - Minecraft#getRenderManager().viewerPosZ));

That's how you get x/y/z.

You need few rotations and little translation to fit your plane (block walls) and draw using:

Tessellator tess = Tessellator.getInstance();
WorldRenderer wr = tess.getWorldRenderer();
wr.addVertex ... and next, and next, and next.

and then draw sting with FontRenderer.

 

 

 

1.7.10 is no longer supported by forge, you are on your own.

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.

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.