Posted April 29, 20169 yr Which event do I need to handle rendering with Tooltips? Its for something a little similar to Thaumcraft's Aspect display above the tooltip.
April 29, 20169 yr ItemTooltipEvent? Gives you (last) chance to modify rendering. 1.7.10 is no longer supported by forge, you are on your own.
April 29, 20169 yr Author ItemTooltipEvent? Gives you (last) chance to modify rendering. That allows me to add to a tooltip (I am using that event) but it does not allow me to render additional information - such as what Thaumcraft does with its aspects.
April 29, 20169 yr Author I found a workaround, in the event that I cannot find a proper method: I used GuiScreenEvent#DrawScreenEvent and recreated GuiUtils#drawHoveringText , removing all the rendering code (this gets me the X and Y of the tooltip, as well as its size). Its a bit messy, but it works for my purposes.
April 29, 20169 yr Okay, I forgot - it's not designed to help (event). You can: (in event) ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); int x = Mouse.getEventX() / scaledresolution.getScaleFactor(); int y = (mc.displayHeight - Mouse.getEventY()) / scaledresolution.getScaleFactor(); Then using that you can render (image i guess, or really anything) using one of Gui.class methods (or other ones). Big note: image will try to render in zLevel = 0, which is not desired since it will just not work (in that event). At least, that is what I remember from some past problems (maybe changed). In that case you can use: GL11.glTranslate(0.0F, 0.0F, zLevel); 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.