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

Hello!

 

So I added tooltips to my gui so when a player hovers over a bar it displays sun intesity on solar panel. This all works fine, but what if I also want the texture to change on that area when player hovers mouse there.

 

What I did below works when mouse is hovered over, but if I pick up 1 of an item then the texture goes white. If I pick up 64 or 12 of an item then everything works, but this only happens when 1 item is picked up.

 

Here is what happens:

 

Any help is appriciated.

 

public void drawScreen(int x, int y, float f) {

	super.drawScreen(x, y, f);
	this.drawToolTipsSunIntensity(x, y);
}

public void drawToolTipsSunIntensity(int mouseX, int mouseY) {
    int boxX = (this.width - this.xSize) / 2 + 28;
    int boxY = (this.height - this.ySize) / 2 + 6;

	int defaultX = 19;
	int defaultY = 48;

	if(mouseX > boxX && mouseX < boxX + defaultX && mouseY > boxY && mouseY < boxY + defaultY) {  

		List list = new ArrayList();                       
                           int currentPower = solarPanel.getSunIntensityPercent();
                           int rf = solarPanel.getCurrentRfgeneration();
                           list.add("\u00a7eSun Intensity:");
                           list.add(currentPower + "%");

                           Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
                           GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                           GL11.glDisable(2896);
                           drawTexturedModalRect(guiLeft + 29, guiTop + 7, 194, 62, 18, 47);       
                           
                           GuiScreen.drawRect(20, 22, 22, 22, 22);
                           this.drawHoveringText(list, mouseX, mouseY, fontRendererObj);
	}       
	else{	
            Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            GL11.glDisable(2896);
            drawTexturedModalRect(guiLeft + 29, guiTop + 7, 176, 62, 18, 47);  		
	}
}

Error is most certainy in superclass GuiContainer#drawScreen.

Where? I got nothing. Look there, some enable/disable stuff like RenderHelper.disableStandardItemLighting();

I have no clue what I am talking about, maybe it will point in right direction :x

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

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.