Jump to content

mInternauta

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

mInternauta's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Sooo i make it! Solved : GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); this.mc.renderEngine.bindTexture(new ResourceLocation("blazemachines", "/textures/gui/display.png")); ScaledResolution sr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); GL11.glColor3d(190, 190, 190); this.drawTexturedModalRect(x, y, 0, 0, sr.getScaledWidth() - 10, sr.getScaledHeight() - 10); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix();
  2. The code is: @Override public void drawScreen(int x, int y, float f) { //super.drawScreen(x, y, f); int xCenter = this.resolution.Width / 2; // Current Minecraft Width int yCenter = this.resolution.Height / 2; // Current Minecraft Height int midRectHeight = this.resolution.UsableHeight / 2; // This is the Current Minecraft Window Size minus the BorderSize int midRectWidth = this.resolution.UsableWidth / 2; // This is the Current Minecraft Window Size minus the BorderSize int topCenter = yCenter - midRectHeight; // Top X to Center the Rectangle int leftCenter = xCenter - midRectWidth; // Left Y to Center the Rectangle drawsScreen(topCenter, leftCenter); } private void drawsScreen(int x, int y) { // drawDefaultBackground(); this.mc.renderEngine.bindTexture(new ResourceLocation("blazemachines", "/textures/gui/display.png")); double yFinal = y + this.resolution.UsableHeight; // This is the Current Minecraft Window Size minus the BorderSize double xFinal = x + this.resolution.UsableWidth; // This is the Current Minecraft Window Size minus the BorderSize yFinal = yFinal - ScreenResolution.BorderSize; // < BorderSize is 10 xFinal = xFinal - ScreenResolution.BorderSize; // < BorderSize is 10 Tessellator tessellator = Tessellator.instance; tessellator.startDrawing(GL11.GL_QUADS); tessellator.addVertexWithUV(x, yFinal, 0, 0.0, 1.0); tessellator.addVertexWithUV(xFinal, yFinal, 0, 1.0, 1.0); tessellator.addVertexWithUV(xFinal, y, 0, 1.0, 0.0); tessellator.addVertexWithUV(x, y, 0, 0.0, 0.0); tessellator.draw(); }
  3. I have a texture with 2048x2048 it simulates a computer monitor, its is to big because the size change with the monitor resolution.. So.. however when I render it with tessellator doesnt assumes the correct scale: Renderized:
  4. Hey people, How can i draw a sub window like ComputerCraft Screen?
  5. How can i render a sub window or glViewport? public void Draw(int x, int y) { drawsScreen(x,y); } private void drawsScreen(int x, int y) { GL11.glViewport(x, y, 400, 400); GL11.glLoadIdentity(); GL11.glBegin(GL11.GL_QUADS); GL11.glColor3d(196, 196, 196); GL11.glVertex2d(x, y); GL11.glVertex2d(x + 100, y); GL11.glVertex2d(x + 100, y + 100); GL11.glVertex2d(x, y + 100); GL11.glEnd(); }
×
×
  • Create New...

Important Information

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