Jump to content

Recommended Posts

Posted (edited)

I am trying to add something like a mana bar to the player's HUD but can't find a way to do so. 

From looking at a ton of different examples (i.e. RWTema's Monk Mod and coolAlias' Tutorial-Demo), a lot of things has changed since 1.12, and I'm not sure what to extend because some files are unable to be viewed. Currently, I am trying to use the RenderGameOverlayEvent.Post event to get the overlay to render, but extending either AbstractGui or IngameGui lead to some problems. It seems that drawTexturedModalRect() is gone and nowhere to be seen. From all the examples I think I need to do something with the Tessellator and TextureAtlasSprite classes. Could anyone give me a hint or lead me in the right direction?

Edited by Nozzomi
Solved
Posted (edited)

i would extend GuiScreen for the Gui (register it on the EventBus on the client side (trough your ClientProxy) 

then i would use the RenderGameOverlayEvent.Post to draw stuff and check if the event Type is not the ElementType Expierence

otherwise look at some tutorials and most of them even if they are outdated you can still use them as reference look trough some of the minecraft gui files that may also help

and 1.14 is pretty buggy so i would recommend 1.13 but your choice

(i did not mod on 1.14 just fyi) 

Edited by Oscarita25
  • Like 1
Posted (edited)

RenderGameOverlayEvent.Pre (or possibly Post) is the right place, but to just draw something on the screen, I don't see the need to extend Screen (which is what GuiScreen is now called in 1.14).  Just draw on the main screen, having checked the element type you want to draw before or after.

 

drawTexturedModalRect() and the various related methods are now all called blit() (overloaded by the parameters they take, which are the same as in 1.12.2 so a direct method rename should be possible), and can be found in AbstractGui.  There is a blit() overload which takes a TextureAtlasSprite, so that should work for you.

 

Tessellator/TextureAtlasSprite code hasn't really changed since 1.12.2 as far as I'm aware. Get your sprite from a TextureStitchEvent.Pre event handler as normal.

 

As for 1.13?  It's a dead-end.  Active development is on 1.14.2 now, and even it's a bit rough right now, it will inevitably improve.

Edited by desht
  • Like 1
Posted
  On 6/19/2019 at 11:24 AM, desht said:

As for 1.13?  It's a dead-end.  Active development is on 1.14.2 now, and even it's a bit rough right now, it will inevitably improve.

Expand  

oh ok thanks for the information ?
 

 

  On 6/19/2019 at 11:24 AM, desht said:

RenderGameOverlayEvent.Pre (or possibly Post)

Expand  

its post if you want to draw after the ElementType that you check for if i am correct (not sure tho) 

Posted (edited)
  On 6/19/2019 at 11:38 AM, Oscarita25 said:

its post if you want to draw after the ElementType that you check for if i am correct (not sure tho) 

Expand  

Yes, that is correct.  It's probably only important if you want to draw specifically over or under an existing element.  If drawing on a separate area of the screen, either should be fine (and of course the Pre event is cancelable, while the Post event is not).

Edited by desht

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • my game keeps crashing right before launching the game before full screen and keeps poping up this error message "error code 1 " The game crashed: rendering overlay Error: java.lang.IllegalAccessError: failed to access class com.mojang.blaze3d.platform.GlStateManager$TextureState from class net.coderbot.iris.gl.IrisRenderSystem$DSAARB (com.mojang.blaze3d.platform.GlStateManager$TextureState is in module minecraft@1.18.2 of loader 'TRANSFORMER' @d919544; net.coderbot.iris.gl.IrisRenderSystem$DSAARB is in module oculus@1.6.4 of loader 'TRANSFORMER' @d919544)
    • removing oculus or any of ETF or EMF or even embeddium doesn't change anything it just crashes again with error -1  https://gist.github.com/Tikalian-coconut/d49e8fb83bf57d5e04eb042522046786 this time i removed all 4 at same time and that gave it something is wrong with the game seriously..
    • crash report -> https://gist.github.com/Tikalian-coconut/18c41f97bdacef54725e5141f57697d7 from what i see it seems like Entity Texture Features doesn't like Oculus doing something or invert.. not sure it's why everything is all black textured but that causes a -1 error
    • well that's bad, cuz there's no crash report at all (the last crash report is from previous replies) it's probably another issue that doesn't fit in this bug report, the game works fine except that everything is black, no texture except the sky and skin, everything else is just black i've tried reloading the textures in game, see for drivers updates but it did nothing, seems like an issue with Embeddium or Oculus i think, but i know nothing compared to you i can still send the latest debug and latest.log files.. edit: it seems that when i re-add rechiseled (1.1.6-1.20.1) it crashes as error 1 (i can't remove it off from the modpack cuz that'll break all my builds on some maps) lemme start the game and get it to crash to get a crash report done)
    • If you've fallen victim to a crypto scam, you're not alone and thankfully, you're not without options. I highly recommend iBolt Cyber Hacker Company for anyone seeking professional and effective assistance in recovering scammed cryptocurrency. After extensive research and hearing from multiple satisfied clients, it's clear that iBolt stands out in a crowded and often unreliable market. Their team of experienced cyber experts and blockchain analysts uses advanced tracking techniques to follow stolen funds across the blockchain and engage with crypto exchanges when possible. They’re not just tech-savvy—they’re strategic and persistent. WHY CHOOSE iBOLT CYBER HACKER COMPANY? (1) Proven success in crypto asset recovery (2) Fast, professional, and discreet service (3) Skilled in blockchain forensics and cyber investigation (4) Committed to fighting online fraud and supporting victims Don’t give up. I strongly recommend reaching out to iBolt Cyber Hacker Company. ENQUIRIES: info @ iboltcyberhack . org/ www . iboltcyberhack. org/ +39. 351. 105. 3619.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.