Posted December 4, 20177 yr 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 December 4, 20177 yr by Melonslise
December 4, 20177 yr 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 December 4, 20177 yr by Melonslise
December 4, 20177 yr 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.
December 4, 20177 yr Look at how the GUI scale factor is used to set the GL scale factor. There is probably a formula or conditional statement somewhere. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
December 4, 20177 yr 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
December 6, 20177 yr 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.