Advertisement
PaleoCrafter

Untitled

May 16th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. public static void drawRectangleStretched(int x, int y, float u, float v, int width, int height, float uMax, float vMax, int zLevel)
  2. {
  3.     float scaleU = 0.00390625F;
  4.     float scaleV = 0.00390625F;
  5.     if (u % 1 != 0 || uMax % 1 != 0) scaleU = 1;
  6.     if (v % 1 != 0 || vMax % 1 != 0) scaleV = 1;
  7.     Tessellator tessellator = Tessellator.instance;
  8.     tessellator.startDrawingQuads();
  9.     tessellator.addVertexWithUV(x, y + height, zLevel, u * scaleU, vMax * scaleV);
  10.     tessellator.addVertexWithUV(x + width, y + height, zLevel, uMax * scaleU, vMax * scaleV);
  11.     tessellator.addVertexWithUV(x + width, y, zLevel, uMax * scaleU, v * scaleV);
  12.     tessellator.addVertexWithUV(x, y, zLevel, u * scaleU, v * scaleV);
  13.     tessellator.draw();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement