Posted October 19, 20223 yr I'm looking to render a tooltip text box like the one you get for hovering over items, eg: I know the basics of rendering including usage of poseStack in render events, but I just don't know where I can find a class method that can do this. I'm also hoping said function includes text formatting (bold, italics, colour, etc.) and (if possible) multiline text wrapping but if I have to write that myself any tips for it would be greatly appreciated.
October 19, 20223 yr 2 hours ago, SoLegendary said: I'm looking to render a tooltip text box like the one you get for hovering over items Screen#renderTooltip 2 hours ago, SoLegendary said: I'm also hoping said function includes text formatting (bold, italics, colour, etc.) Set the style on the passed in components. 2 hours ago, SoLegendary said: (if possible) multiline text wrapping In the method mentioned first.
October 20, 20223 yr Author On 10/20/2022 at 12:52 AM, ChampionAsh5357 said: Screen#renderTooltip Set the style on the passed in components. In the method mentioned first. Ok cool, I got it working now. One other feature I would like is rendering icons on the box, inline if possible. Unicode sounds like the most compatible solution but barring that if I could at least get the coordinates that the tooltip box corners are rendered at so I can just blit my own graphics that'd work too.
October 22, 20223 yr On 10/20/2022 at 7:18 PM, SoLegendary said: One other feature I would like is rendering icons on the box, inline if possible. Unicode sounds like the most compatible solution but barring that if I could at least get the coordinates that the tooltip box corners are rendered at so I can just blit my own graphics that'd work too. Try it an see, they both sound like plausible solutions. The latter may be better since unicode may not be translated across languages.
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.