Posted July 16, 20187 yr The goal of my mod is to replace heldItemTooltips with the ones from Console Edition which show enchantments and certain nbt tags in addition to the name of the current object. My replacement is supposed to fade away after a short time like the vanilla heldItemTooltips do. I'm having a problem with text that is supposed to be transparent. There is also a shadow behind it which currently leads to an interesting effect, but not my desired result: The text is only transparent where the coloured text and its shadow overlap. I'm using RenderGameOverlayEvent.Pre to render the text. Nothing is changed with GlStateManager before rendering, I'm guessing that my problem is caused by that and that I need to configure some GlStateManager settings, but I'm not finding the correct one. But maybe it's something completely else. My code for this project can be found in this file on Github. I hope that someone is able to point me to the problem since I've really tried a lot and so far nothing is making everything fade away like it is supposed to. Thank you guys in advance! __________________________________________________________________________________________________________________ EDIT a very long time later for anyone who stumbles across this post trying to fix a similar issue in their own mod like I do all the time on this forum: The issue was simply the text being rendered every time RenderGameOverlayEvent.Pre is called. I just forgot to check for event.getType() == RenderGameOverlayEvent.ElementType.ALL Because in the end running on Pre for ALL is actually a lot better for this purpose than using the Text event recommended below. Edited May 10, 20196 yr by Fusseel found the solution by now
July 16, 20187 yr 15 minutes ago, Fusseel said: The goal of my mod is to replace heldItemTooltips with the ones from Console Edition which show enchantments and certain nbt tags in addition to the name of the current object. My replacement is supposed to fade away after a short time like the vanilla heldItemTooltips do. I'm having a problem with text that is supposed to be transparent. There is also a shadow behind it which currently leads to an interesting effect, but not my desired result: The text is only transparent where the coloured text and its shadow overlap. I'm using RenderGameOverlayEvent.Pre to render the text. Nothing is changed with GlStateManager before rendering, I'm guessing that my problem is caused by that and that I need to configure some GlStateManager settings, but I'm not finding the correct one. But maybe it's something completely else. My code for this project can be found in this file on Github. I hope that someone is able to point me to the problem since I've really tried a lot and so far nothing is making everything fade away like it is supposed to. Thank you guys in advance! Take a look at GuiIngame#renderSelectedItem(ScaledResolution) lines 694-699 VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 16, 20187 yr Author Thanks a lot for your quick reply, but that doesn't really help. I've actually started from the vanilla code. But it's a bit different when working with RenderGameOverlayEvent.Pre since the GlStateManager settings are different. enableBlend() and tryBlendFuncSeparate() are already set the way they should be and pushMatrix or pushMatrix don't have any effect at this point. So it has to be something else. Edited July 16, 20187 yr by Fusseel
July 16, 20187 yr 45 minutes ago, Fusseel said: Thanks a lot for your quick reply, but that doesn't really help. I've actually started from the vanilla code. But it's a bit different when working with RenderGameOverlayEvent.Pre since the GlStateManager settings are different. enableBlend() and tryBlendFuncSeparate() are already set the way they should be and pushMatrix or pushMatrix don't have any effect at this point. So it has to be something else. it seems you need to use RenderGameOverlayEvent.Text to render text. So you may need both RenderGameOverlayEvent.Pre to cancel the item tooltips, and RenderGameOverlayEvent.Text to actually render. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 16, 20187 yr Author 39 minutes ago, Animefan8888 said: it seems you need to use RenderGameOverlayEvent.Text to render text. So you may need both RenderGameOverlayEvent.Pre to cancel the item tooltips, and RenderGameOverlayEvent.Text to actually render. Wow, that's actually it. Thank you so much! Calling RenderGameOverlayEvent.Pre won't be necessary at all then since heldItemTooltips can only be disabled using a vanilla setting.
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.