Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Implement Gui Scaling #68

Closed
5HT2 opened this issue Nov 3, 2019 · 15 comments
Closed

Implement Gui Scaling #68

5HT2 opened this issue Nov 3, 2019 · 15 comments
Labels
-gui -help-wanted Extra attention is needed enhancement good-first-issue This is a good suggestion / bug report
Milestone

Comments

@5HT2
Copy link
Member

5HT2 commented Nov 3, 2019

Temp solution: make your Minecraft GUI smaller

@5HT2 5HT2 added bug -help-wanted Extra attention is needed labels Nov 3, 2019
@5HT2 5HT2 added this to the b9 1.3 milestone Nov 3, 2019
@5HT2 5HT2 changed the title If your GUI is too small some menus go off screen If your GUI is too large some menus go off screen Nov 5, 2019
@5HT2

This comment has been minimized.

@zeroeightysix
Copy link
Contributor

The entirety of the GUI is scaled by the factor given by DisplayGuiScreen's getScale: https://github.com/S-B99/KAMI/blob/da2ff767f9cff6fc0dcb635460ac966508e4057e/src/main/java/me/zeroeightsix/kami/gui/kami/DisplayGuiScreen.java#L104

@5HT2 5HT2 mentioned this issue Nov 23, 2019
@5HT2 5HT2 added bug/visual and removed bug labels Nov 24, 2019
@5HT2
Copy link
Member Author

5HT2 commented Nov 26, 2019

Someone suggested a seperate scale for right click menu, I don't think it's possible but having a scale in settings is

  • A scale for category size should be linked to text size as well

  • Also moving menus by default depending on minecrafts GUI size so they don't go off screen would be good

@5HT2 5HT2 added the good-first-issue This is a good suggestion / bug report label Dec 7, 2019
@5HT2 5HT2 closed this as completed in de5c904 Dec 10, 2019
5HT2 added a commit that referenced this issue Dec 10, 2019
@5HT2
Copy link
Member Author

5HT2 commented Jan 7, 2020

I actually reverted that commit so uh oops

@5HT2 5HT2 reopened this Jan 7, 2020
@5HT2 5HT2 modified the milestones: v1.1.3, v1.1.4, v1.1.5 Jan 14, 2020
@5HT2 5HT2 pinned this issue Mar 17, 2020
@Tigermouthbear
Copy link
Contributor

You might be able to gl scale everything down to fit the scaled resolution before rendering

@5HT2
Copy link
Member Author

5HT2 commented Mar 20, 2020

no clue where it starts to render though

@5HT2
Copy link
Member Author

5HT2 commented Mar 20, 2020

To scale the rendered GUI elements (with the exception of my hacky inventory viewer, which I can change), you can add

GlStateManager.scale(0.5f, 0.5f, 0.5f);

to UIRenderer.java
2020-03-20-155322_360x471_scrot

@5HT2 5HT2 modified the milestones: v1.1.5, v1.1.3, v1.1.4 Mar 20, 2020
@5HT2
Copy link
Member Author

5HT2 commented Mar 22, 2020

I didn't get much further then above, because the inside of ui frames seems to scale the text and box seperately and it completely breaks, and I couldn't figure out where those are rendered

@5HT2 5HT2 modified the milestones: v1.1.4, v1.1.3 Mar 22, 2020
@5HT2
Copy link
Member Author

5HT2 commented Mar 22, 2020

In addition to that, AbstractContainer.java#L39 calls this method KamiFrameUI.java#L185 which is used to determine where to place them, so I can also fix that to not put them off screen by default.

5HT2 added a commit that referenced this issue Mar 25, 2020
@5HT2 5HT2 changed the title If your GUI is too large some menus go off screen Implement Gui Scaling Mar 25, 2020
@5HT2 5HT2 modified the milestones: v1.1.3, v1.1.5 Mar 25, 2020
@5HT2
Copy link
Member Author

5HT2 commented Mar 25, 2020

For now, Gui elements cannot go off screen no matter what. Hopefully I'll get around to making a GUI scale someday.

@5HT2
Copy link
Member Author

5HT2 commented Apr 18, 2020

As I've gotten better at GL since last commenting on this, you just push matrix, scale, and pop. The hard part is putting it into everything that renders.

@5HT2 5HT2 closed this as completed Apr 18, 2020
@5HT2
Copy link
Member Author

5HT2 commented Apr 18, 2020

Oops didn't mean to close

@5HT2 5HT2 reopened this Apr 18, 2020
@5HT2 5HT2 modified the milestones: v1.1.5, v1.1.4 Apr 18, 2020
@5HT2
Copy link
Member Author

5HT2 commented Apr 18, 2020

Moving this to later because after adding scaling (some stuff worked) as it turns out all the spacing and everything is hardcoded, oops

@5HT2 5HT2 modified the milestones: v1.1.4, v1.1.7 Apr 18, 2020
@5HT2 5HT2 modified the milestones: v1.1.7, long-term May 3, 2020
@5HT2
Copy link
Member Author

5HT2 commented May 7, 2020

See #790.

@5HT2 5HT2 closed this as completed May 7, 2020
@5HT2 5HT2 unpinned this issue May 7, 2020
@5HT2 5HT2 modified the milestones: long-term, v1.1.4 May 7, 2020
@5HT2 5HT2 mentioned this issue Aug 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
-gui -help-wanted Extra attention is needed enhancement good-first-issue This is a good suggestion / bug report
Projects
None yet
Development

No branches or pull requests

3 participants