Jump to content

Recommended Posts

Posted

I've been trying to render a line on the screen for a few days now, and everywhere I've looked has outdated answers. They say to use RenderGameOverlayEvent, which has been removed by my understanding. Is there a specific event I should be using or anything else I'm doing wrong?

Tesselator tesselator = Tesselator.getInstance();
BufferBuilder renderer = tesselator.getBuilder();
renderer.begin(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR);
Color c = new Color(255, 0, 0, 255);
renderer.vertex(0, 100, 0).color(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()).endVertex();
renderer.vertex(0, 200, 0).color(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()).endVertex();
tesselator.end();

Based on what I've seen, this is the code that should be working, though I feel that I need to override an event and add it in. What event should I be using for this? Is there another way of doing it that I don't know of?

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.