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

As all the people that mess around with "Gui InGame" would know, that you can only get things to render to the right side of the screen easily (so when the player changes the screen size it stays in the same place) and I'm wondering if you're able to do the same thing but on the left side instead.

 

I mean so when you set a spot for the overlay on the left, it corresponds with the screen size so you don't just have a random overlay sitting in the middle of the screen when you're going in full screen.

 

Any help?

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

  • Author
@SubscribeEvent
public void tickEvent(RenderTickEvent event) {
	GuiIngame gig = mc.ingameGUI;
	FontRenderer font = mc.fontRendererObj;
	EntityPlayer player = mc.thePlayer;
	if(mc.currentScreen == null || mc.currentScreen instanceof GuiChat) {
		if(!mc.gameSettings.showDebugInfo) {
			if(SlayerAPI.BETA) mc.fontRendererObj.drawString(EnumChatFormatting.DARK_GREEN + "Essence of the Gods: " + EnumChatFormatting.DARK_RED + SlayerAPI.MOD_VERSION, 5, 5, 0);
			if(!player.capabilities.isCreativeMode) {
				mc.getTextureManager().bindTexture(new ResourceLocation(SlayerAPI.PREFIX + "textures/gui/playerStats.png"));
				float health = player.getHealth() * 5F;
				float hunger = player.getFoodStats().getFoodLevel() * 5F;
				float experience = (int)(mc.thePlayer.experience * 150F);
				float armor = player.getTotalArmorValue() * 5;
				float air = (float)player.getAir() / 1.5F / 2F;
				ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
				int w = res.getScaledWidth() - 160, h = 10;
				GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
				GL11.glEnable(GL11.GL_BLEND);
				int lengthOfBar = 151;
				gig.drawTexturedModalRect(w - 10, h, 0, 0, lengthOfBar, 108 - 18);
				gig.drawTexturedModalRect(w - 10, h + 108 - 18, 0, 90, lengthOfBar, 18);
				gig.drawTexturedModalRect(w - 10, h + 108, 0, 235, 182, 18);

				gig.drawTexturedModalRect(w - 10, h, 0, 109, (int)(health * 1.5F), 18);
				gig.drawTexturedModalRect(w - 10 + 3, h + 3, 0, 199, 12, 11);

				gig.drawTexturedModalRect(w - 10, h + 18, 0, 127, (int)(hunger * 1.5F), 18);
				gig.drawTexturedModalRect(w - 10 + 3, h + 21, 0, 210, 12, 11);

				gig.drawTexturedModalRect(w - 10, h + 36 + 18 + 17, 0, 180, (int)(armor * 1.5F), 18);
				gig.drawTexturedModalRect(w - 10 + 3, h + 36 + 40, 17, 210, 9, 9);

				gig.drawTexturedModalRect(w - 10, h + 36 + 36 - 18, 0, 163, (int)(air * 2), 18);
				gig.drawTexturedModalRect(w - 10 + 3, h + 36 + 40 - 18, 17, 200, 9, 9);

				gig.drawTexturedModalRect(w - 10, h + 36, 0, 145, (int)experience, 18);
				GL11.glPushMatrix();
				GL11.glColor4f(0.4F, 1.0F, 0.3F, 1.0F);
				gig.drawTexturedModalRect(w - 10 + 3, h + 38, 0, 221, 14, 14);
				GL11.glPopMatrix();
				GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

				font.drawString(I18n.format("essence.healthbar", new Object[0]) + " " + health + "%", w - 10 + 20, h + 5, 0xFFFFFF);
				font.drawString(I18n.format("essence.hungerbar", new Object[0]) + " " + hunger + "%" , w - 10 + 20, h + 23, 0xFFFFFF);
				font.drawString(I18n.format("essence.armorbar", new Object[0]) + " " + armor + "%", w - 10 + 20, h + 36 + 23 + 18, 0xFFFFFF);
				if(player.getAir() <= 0) font.drawString(I18n.format("essence.airbar", new Object[0]) + " " + "0%" , w - 10 + 20, h + 36 - 18 + 42, 0xFFFFFF);
				else font.drawString(I18n.format("essence.airbar", new Object[0]) + " " + (int)air + "%" , w - 10 + 20, h + 36 - 18 + 42, 0xFFFFFF);
				font.drawString(I18n.format("essence.xpbar", new Object[0]) + " " + mc.thePlayer.experienceLevel , w - 10 + 20, h + 41, 0xFFFFFF);
				String st = I18n.format("essence.time", new Object[0]) + " " + formatTime(getWorldTime(mc));
				font.drawString(st, w - 10 + 3, h + 41 + 36 + 18, 0xFFFFFF);
				font.drawString(I18n.format("essence.coords", new Object[0]) + " X: " + (int)player.posX + ", Y: " + (int)(player.posY - 1) + ", Z: " + (int)player.posZ, w - 10 + 5, h + 36 + 78, 0xFFFFFF);
				GL11.glDisable(GL11.GL_BLEND);
			}
		}
	}
}

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

  • Author

Okay, nevermind... I'm so stupid xD

 

I removed the ScaledResolution and replaced that with a 0

 

It now renders on the left side and changes when you change the screen size. Thanks anyway :P

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.