Jump to content

Gui rendering in the wrong spot when window is resized


The_Fireplace

Recommended Posts

Ok, I have a Gui which renders fine when the window is small, but when the window is maximized/put in to fullscreen, it renders in the wrong spot.

 

zofQm7b.pngJvO2LLr.png

 

My setup is: the UtilityGui renders, then at the end of its render code, tells the overlay gui to render on top of it. Then, the foreground(just 1 item icon in the screenshots) renders over that. The foreground and UtilityGui render correctly, it is the overlay gui(GuiFireplaceCoreTab) that is in the wrong spot. Here is my code:

GuiFireplaceCoreTab:

https://bitbucket.org/The_Fireplace/fireplace-core/src/ae9361509a1bd65c5a09b5cdfaa1b7766a33b844/src/main/java/the_fireplace/fireplacecore/gui/GuiFireplaceCoreTab.java?at=master

GuiModTab(superclass of GuiFireplaceCoreTab):

https://bitbucket.org/The_Fireplace/fireplace-core/src/ae9361509a1bd65c5a09b5cdfaa1b7766a33b844/src/main/java/the_fireplace/fireplacecore/gui/GuiModTab.java?at=master

UtilityGui(link to the line it makes GuiFireplaceCoreTab render):

https://bitbucket.org/The_Fireplace/fireplace-core/src/ae9361509a1bd65c5a09b5cdfaa1b7766a33b844/src/main/java/the_fireplace/fireplacecore/gui/UtilityGui.java?at=master#cl-216

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Link to comment
Share on other sites

You should move your gui constructor code into the initGui, since it is called when gui is opened and scaled.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

You should move your gui constructor code into the initGui, since it is called when gui is opened and scaled.

All that did was cause the gui to center on 0,0; at least when it is in the constructor, it centers correctly when the screen is small.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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