IvanTune Posted September 21, 2015 Share Posted September 21, 2015 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); } } Quote Link to comment Share on other sites More sharing options...
Ernio Posted September 21, 2015 Share Posted September 21, 2015 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 Quote 1.7.10 is no longer supported by forge, you are on your own. Link to comment Share on other sites More sharing options...
Recommended Posts
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.