Jump to content

MysticalBilly

Members
  • Posts

    4
  • Joined

  • Last visited

MysticalBilly's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I looked at your link, but it seemed to be for rendering images. Could you send me some code for just drawing a plain rectangle (by knowing the vertices)? You are correct about me trying to draw an overlay.
  2. Could you send some example code, and which imports to use?
  3. Could anyone send me a function that would draw a rectangle on the user's screen, given (x1, x2, y1, y2), every frame? (I am new to forge) I have tried asking this for 1.8.9, but that is old, so I updated to a more recent version of the game.
  4. All I want to do is draw a red rectangle on the user's screen. How would I do this? I tried public void drawFilledRectangle(int x1, int y1, int x2, int y2) { if (x1 < x2) { int tempX = x1; x1 = x2; x2 = tempX; } if (y1 < y2) { int tempY = y1; y1 = y2; y2 = tempY; } double x1a = x1; double x2a = x2; double y1a = y1; double y2a = y2; Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); GlStateManager.enableColorLogic(); GlStateManager.enableNormalize();; GlStateManager.viewport(770, 771, 1, 0); GlStateManager.color(1, 0, 0, 1); worldrenderer.begin(7, DefaultVertexFormats.POSITION_NORMAL); worldrenderer.setTranslation((double)x1a, (double)y2a, 0.0D); worldrenderer.setTranslation(x2a, y2a, 0.0D); worldrenderer.setTranslation(x2a, y1a, 0.0D); worldrenderer.setTranslation(x1a, y1a, 0.0D); tessellator.draw(); GlStateManager.disableColorLogic(); GlStateManager.disableNormalize(); } but then Minecraft crashes: The game crashed whilst unexpected errorError: java.lang.NoSuchMethodError: net.minecraft.client.renderer.Tessellator.getInstance()Lnet/minecraft/client/renderer/Tessellator; Can anyone send me a draw filled rectangle method that works in 1.8.9?
×
×
  • Create New...

Important Information

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