Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OsipXD

Members
  • Joined

  • Last visited

Everything posted by OsipXD

  1. Hi, Thanks a lot for help!
  2. @TheGreyGhost Thanks a lot. I wrote GL11.glTranslatef(0.0f, 0.0f,-1.0f), and that helped. But I'm not quite sure what it is the right decision. Is not it bad form? @coolAlias Thanks for the advice. I've tried it, but it did not help. P.S. I like it :3 [spoiler=Screenshot]
  3. Oh... it's a pity :sad:... Thanks for trying to help P.S. I tried to write the method drawRect without tessellator. When I add the last line GL11.glLoadIdentity(); rectangle becomes transparent, but a new problem arises. All included as a standard GUI becomes invisible. Without this line, rectangle, still not transparent. [spoiler=Code] /** * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color */ public static void drawRect(int par0, int par1, int par2, int par3, int par4) { int j1; if (par0 < par2) { j1 = par0; par0 = par2; par2 = j1; } if (par1 < par3) { j1 = par1; par1 = par3; par3 = j1; } float f = (float)(par4 >> 24 & 255) / 255.0F; float f1 = (float)(par4 >> 16 & 255) / 255.0F; float f2 = (float)(par4 >> 8 & 255) / 255.0F; float f3 = (float)(par4 & 255) / 255.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(f1, f2, f3, f); GL11.glBegin(GL11.GL_QUADS); GL11.glVertex2f((float) par0, (float) par3); GL11.glVertex2f((float) par2, (float) par3); GL11.glVertex2f((float) par2, (float) par1); GL11.glVertex2f((float) par0, (float) par1); GL11.glEnd(); GL11.glDisable(GL11.GL_BLEND); // ** THE MAGIC BEGINS ** GL11.glLoadIdentity(); // ** MAGIC ENDS *** } [spoiler=Screenshot] I almost do not know how to use LWJGL. Help please.
  4. Thanks for the advice, but method darwRect() contains this. [spoiler=Gui.drawRect()] /** * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color */ public static void drawRect(int par0, int par1, int par2, int par3, int par4) { int j1; if (par0 < par2) { j1 = par0; par0 = par2; par2 = j1; } if (par1 < par3) { j1 = par1; par1 = par3; par3 = j1; } float f = (float)(par4 >> 24 & 255) / 255.0F; float f1 = (float)(par4 >> 16 & 255) / 255.0F; float f2 = (float)(par4 >> 8 & 255) / 255.0F; float f3 = (float)(par4 & 255) / 255.0F; Tessellator tessellator = Tessellator.instance; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(f1, f2, f3, f); tessellator.startDrawingQuads(); tessellator.addVertex((double)par0, (double)par3, 0.0D); tessellator.addVertex((double)par2, (double)par3, 0.0D); tessellator.addVertex((double)par2, (double)par1, 0.0D); tessellator.addVertex((double)par0, (double)par1, 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); }
  5. Hello, I'm trying to draw a translucent rectangle with Gui.drawRect(); But I did not get :-( What am I doing wrong? [spoiler=Code] @ForgeSubscribe(priority = EventPriority.NORMAL) public void renderDebugMonitor(RenderGameOverlayEvent event) { ScaledResolution res = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); posX = res.getScaledWidth() - spaceRigth; // Draw background // posX, posY, descSpace, spaceRight and fontRender is global staic varibles int x1 = posX - descSpace - 5; int y1 = posY + 8 * (this.fontRender.FONT_HEIGHT + 2) + 5; int x2 = posX + 5; int y2 = posY - 5; Color color = new Color(85, 75, 59, 140); // Alfa is 140, but a rectangle is not translucent drawRect(x1, y1, x2, y2, color.getRGB()); } [spoiler=Screenshot] Sorry for my bad English, it's not my first language.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.