Posted March 30, 20169 yr Hey, how is it possible to draw a string like the fps or the cords ingame? I tryed to make it with a RenderGameOverlayEvent but it then just crashed the game. Thanks for any help
March 30, 20169 yr Author @SubscribeEvent public void onRender(RenderGameOverlayEvent event){ if(!event.isCancelable() && event.getType() == net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.EXPERIENCE){ int posX = 3; int posY = event.getResolution().getScaledHeight() - 10; drawString(fontRendererObj, "test", posX, posY, 1); } } Crash report : http://pastebin.com/yP4BFdVY
March 30, 20169 yr Author - Do not subscribe to the raw RenderGameOverlayEvent. Choose Pre or Post. What do you mean with this? Or could you please send me what do you mean?
March 30, 20169 yr There are multiple sub-events that you have to choose from. Most sub-events are static classes from the raw event. So you don't choose RenderGameOverlayEvent , but either RenderGameOverlayEvent.Pre or RenderGameOverlayEvent.Post . Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
March 30, 20169 yr Author Still dont work. @SubscribeEvent public void onRender(RenderGameOverlayEvent.Pre event){ if(event.getType() == net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.EXPERIENCE){ int x = 3; int y = event.getResolution().getScaledHeight() - 10; fontRendererObj.drawString("text", x, y, 0xffffff); } } Crash Report http://pastebin.com/raw/uE6syD2s
March 30, 20169 yr - Your fontRendererObj field is null. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
March 31, 20169 yr Author - Your fontRendererObj field is null. Ok i know but how can i fix it? I cant find any solution on google or on any other post. Sorry but im realy new to Forge modding.
March 31, 20169 yr you can get the fontRendererObj via Minecraft.getMinecraft().fontRendererObj or sth like that. use ur ide to find the exact name
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.