Advertisement
Guest User

Untitled

a guest
May 28th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public void drawTexturedRectangle(double x, double y, double width, double height, double zIndex, String texture){
  2. textureManager.bindTexture(new ResourceLocation(WAIH.MODID, texture));
  3. vertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
  4. vertexBuffer.pos(x - width/2, y - height/2, zIndex).tex(0, 0).color(1.0f, 1.0f, 1.0f, 0.75f).endVertex();
  5. vertexBuffer.pos(x - width/2, y + height/2, zIndex).tex(0, 1).color(1.0f, 1.0f, 1.0f, 0.75f).endVertex();
  6. vertexBuffer.pos(x + width/2, y + height/2, zIndex).tex(1, 1).color(1.0f, 1.0f, 1.0f, 0.75f).endVertex();
  7. vertexBuffer.pos(x + width/2, y - height/2, zIndex).tex(1, 0).color(1.0f, 1.0f, 1.0f, 0.75f).endVertex();
  8. tessellator.draw();
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement