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

I want my gui to maintain position and size proportional to the screen resolution and not be affected by the gui scale factor.

To keep the size I've tried many different ways like getting the gui scale factor from the settings, dividing the resolution by the texture dimensions and so on, but I haven't been successful so far.

I also don't understand how the position affects drawing a texture. I thought that positions would be relative to resolution, but I've found that setting anything more than around ~400 will cause the texture to disappear completely (considering I have a 1080p screen).

Edited by Melonslise

  • Author

How would be harmful to accessibility and usability of the mod? The gui can't be interacted with anyway so I doubt it would be much of a problem.

 

How do I invert the glScale using the gui scaling factor? From what I've tested the factor returns strange values like 0 for auto, 1 for small, 2 for normal, etc. This isn't particularly helpful.

Edited by Melonslise

  • Author

Well in my case I'm actually improving the readability. I need the gui stretched across almost the whole screen.

 

I've gathered as much by now. As I said, the problem lies in the values of the scale factor (at least the one I'm getting from the game settings). I wouldn't be able to to divide by 0 for instance.

1 hour ago, Melonslise said:

Well in my case I'm actually improving the readability. I need the gui stretched across almost the whole screen.

 

I've gathered as much by now. As I said, the problem lies in the values of the scale factor (at least the one I'm getting from the game settings). I wouldn't be able to to divide by 0 for instance.

I did a tutorial on this some time ago and although its a bad one, you may find some ideas there on how you will do it. Mine was pretty much hard coded though

Have you tried setting xSize, ySize, guiLeft and guiTop? For example:

 

@Override
	public void initGui() {
		super.initGui();
		
		xSize=width-10;
		ySize=height-10;
		guiLeft=(width-xSize)/2;
		guiTop=(height-ySize)/2;
	}

"width" and "height" fields are the ones that scale when screen size changes.

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.