Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

What I'm trying to do, is that on the press of a key, in this case, Z an overlay appears if you're holding an item. I know everything up until the rendering works. However, when it tries to render, my method for finding the xPos and yPos to start drawing my Rectangle gets screwed up, and goes into negatives, and even when it's not in negatives, it won't render.

 

Here's my code for KeyInputHandler: http://pastebin.com/JNNVSnDu

Here's what the numbers are coming up as:

Scaled Width: 427

Scaled Height: 240

X-Pos 299

Y-Pos 112

 

And it doesn't render. Any help would be greatly appreciated! Thanks in Advance :D

Big mistake: (accssing) Proper way:

int w = event.resolution.getScaledWidth();
int h = event.resolution.getScaledHeight();

 

And again - you are doing it wrong. Rendering ANYTHING onto overlay SHOULD happen in GuiRenderGameOverlayEvent.

http://www.minecraftforge.net/wiki/Key_Binding

After you have you KeyBinding object , you can chk for it's "isPressed" or something like it. Then you can use this variable inside GRGOEvent. Inside that event (overlay), you call code I gave you above.

  Quote

1.7.10 is no longer supported by forge, you are on your own.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.