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

Hey everyone, I'm making a mod that adds a container, so it adds slots. When developing I leave my minecraft's screen small (it doesn't  cover the whole screen) so I , when developing, put the coords of the slots based on the small Gui. I was wondering if there's any way to detect if the Minecraft screen is or not in Fullscreen, so that I could put the coords based on that.

 

I know I could go with the width and height, but it was too messy, and I didn't really want to spend hours finding it.

 

Any ideas would be really appreciated.

"I an atom in the universe, a universe of atoms"-- Richard P. Feynman

Knowing the middle of the gui is always in the middle of the screen, you can use (width-xSize)/2. That gives you the middle of the screen, and base your slots around that value (same for the y but height and ySize

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/

  • Author

for some reason, it gives me the most top left pixel of the screen. It kinda helps me, I can set up the coords for it but only at the resolution of my screen.

 

Here are the classes:

 

https://github.com/gjkf/GjkfLib/blob/master/src/main/java/com/gjkf/lib/gui/GuiScreenWidget.java

https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/client/gui/RadioCrystalGui.java

 

Thanks for the help

"I an atom in the universe, a universe of atoms"-- Richard P. Feynman

You are setting the minX and minY values to getMinX() and getMinY() method in GuiScreenWidget, but those are 0 because they're not initialised. Then you pass in those values, but because the passed in values are 0, you set the minX and minY values to 0. You have 2 options with your current setup:

1) in the RadioCrystalGui, call the super method without parameters, or

2) pass 176 and 166 (default values) instead of minX and minY.

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/

  • Author

This is the log I get (I print into the log minX and minY)

 

[14:42:37] [Client thread/INFO] [HeadPhonesRadio]: MinX: 0

[14:42:37] [Client thread/INFO] [HeadPhonesRadio]: MinY: 0

 

I get this with both your methods.

 

This is how I did it

 

Main.log.info("MinX: " + minX);
Main.log.info("MinY: " + minY);

 

I'm sorry if I made some stupid errors but I can't really figure it out.

 

Couldn't I just do width/2 and height/2 to find the middle point, that should always be the same?

 

EDIT: Look at the same classes for what I came up now. I keep getting 0 using the library,  in the actual mod I get the correct result

 

EDIT: Fixed it, thanks for the help

"I an atom in the universe, a universe of atoms"-- Richard P. Feynman

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.