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.

Featured Replies

Posted

I am attempting to render progress bar and string in RenderGameOverlayEvent.Pre.

 

No matter where I put mc.fontRendererObj.drawString(...) it always renders under bar.

 

2dkn87n.jpg

 

mc.fontRendererObj.drawString(skillCast.getName(), xPos, yPos, 0xffffff);
	double progress = (double) ((float) skillCast.getCastProgress() / (float) skillCast.getCastTime());
	GuiHelper.drawOutlinedBox(xPos, yPos, (int) (progress * 100), 4, 1.0F, ClientReference.BOX_INNER_COLOR, ClientReference.BOX_INNER_COLOR);
	mc.fontRendererObj.drawString(skillCast.getName(), xPos, yPos, 0xffffff);

 

String is being rendered first and last - still is under bar.

 

Does FR has some totally separate rendering queue?

1.7.10 is no longer supported by forge, you are on your own.

  • Author

public static void drawOutlinedBox(final int x, final int y, final int width, final int height, final float zLevel, final int color, final int outlineColor)
{
	GL11.glPushMatrix();
	drawSolidRect(x * 2 - 2, y * 2 - 2, (x + width) * 2 + 2, (y + height) * 2 + 2, zLevel, outlineColor);
	drawSolidRect(x * 2 - 1, y * 2 - 1, (x + width) * 2 + 1, (y + height) * 2 + 1, zLevel, color);
	GL11.glPopMatrix();
}

public static void drawSolidRect(final int x, final int y, final int width, final int height, final float zLevel, final int color)
{
	GL11.glPushMatrix();
	final Color color1 = new Color(color);
	final Tessellator tess = Tessellator.getInstance();
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	tess.getWorldRenderer().startDrawingQuads();
	tess.getWorldRenderer().setColorOpaque(color1.getRed(), color1.getGreen(), color1.getBlue());
	tess.getWorldRenderer().addVertex(x, height, zLevel);
	tess.getWorldRenderer().addVertex(width, height, zLevel);
	tess.getWorldRenderer().addVertex(width, y, zLevel);
	tess.getWorldRenderer().addVertex(x, y, zLevel);
	tess.draw();
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glPopMatrix();
}

 

Note: I am doing it totally for testing now, but can't find reason why it's rendering under.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

That solves the problem, thanks!

1.7.10 is no longer supported by forge, you are on your own.

Guest
This topic is now closed to further replies.

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.