Posted June 23, 20178 yr Hi, I've got a little question: How can I render something like a progress bar or a text or what ever centered on the screen? Note: For rendering I'm using the RenderGameOverlayEvent.Post event. It would also be quite nice to know how to render stuff with this event centered on the block the player is looking at. Thx in advance. Bektor Edited June 23, 20178 yr by Bektor Developer of Primeval Forest.
June 23, 20178 yr Author Just now, diesieben07 said: As for centered on screen: centeredPosition = (dimensionOfScreen - dimensionOfThing) / 2 Dimension being either width or height, depending on in which dimension you want to center. As for rendering on the block... you should use DrawBlockHighlightEvent for that, which is fired when the block highlight (wireframe) is drawn. Check out RenderGlobal::drawSelectionBox to see how that is done and adapt it for your needs. Ok, thx, but from where do I get width and height of the screen? Developer of Primeval Forest.
June 23, 20178 yr Author 1 minute ago, diesieben07 said: Minecraft::displayWidth / Minecraft::displayHeight. Ok, thx. Developer of Primeval Forest.
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.