It is shifting because I am manually telling the inventory to shift in the x and the y a certain number of pixels, which changes when the screen changes size... I am not sure how to fix it however...
I don't know HOW.
I know the GUI can all be in relation to each other because I have access to the this.xSize and this.ySize along with this.width and this.height. I am able to do some basic math to get them in correct positions all the time. However, the slots are bewildering me. I tried Minecraft.getMinecraft().displayWidth and Height, but those are sometimes the same, sometimes 2x the size, and sometimes just plain off after System.out testing.
I have another machine in one of my other mods working fine, which is why I am so bewildered with this. The code is not in depth or messy yet because I wanted to get the GUI working first... Any ideas as to what I am doing wrong? How do I access the screen size stuff to make sure the slots stay in relation to the GUI? I was always under the assumption as long as your xSize and ySize were defined right it would basically work???
Btw, I double checked the xSize and ySize, they are defined correctly.
This person had the same problem but no one answered the question :/ I couldn't find others online that had the exact problem...
So the problem is this:
I know WHAT the problem...
I have an idea WHY the problem keeps happening...
It is shifting because I am manually telling the inventory to shift in the x and the y a certain number of pixels, which changes when the screen changes size... I am not sure how to fix it however...
I don't know HOW.
I know the GUI can all be in relation to each other because I have access to the this.xSize and this.ySize along with this.width and this.height. I am able to do some basic math to get them in correct positions all the time. However, the slots are bewildering me. I tried Minecraft.getMinecraft().displayWidth and Height, but those are sometimes the same, sometimes 2x the size, and sometimes just plain off after System.out testing.
I have another machine in one of my other mods working fine, which is why I am so bewildered with this. The code is not in depth or messy yet because I wanted to get the GUI working first... Any ideas as to what I am doing wrong? How do I access the screen size stuff to make sure the slots stay in relation to the GUI? I was always under the assumption as long as your xSize and ySize were defined right it would basically work???
Btw, I double checked the xSize and ySize, they are defined correctly.
This person had the same problem but no one answered the question :/ I couldn't find others online that had the exact problem...
http://www.minecraftforge.net/forum/index.php?topic=17081.0
Here is my container class:
http://pastebin.com/V3muqhp0
Here is my GUI class:
http://pastebin.com/w5N4h6wP
Any ideas? -EDIT: It will take me a while to respond because it's 5 in the morning and I haven't slept... lol
Mod Author and Owner of Blockhole
Owner of other discontinued or status frozen work: LimpCraft2, LimpCore, InventoryCalculator, VillageTech, Bitto'Color.
Resolved on my own.
I set the guiLeft and guiTop to be where my gui was initially starting to begin with instead of setting this.xSize and this.ySize
Then I just offset as need be. The container places slots in relation to guiLeft and guiTop, as I found out.
Mod Author and Owner of Blockhole
Owner of other discontinued or status frozen work: LimpCraft2, LimpCore, InventoryCalculator, VillageTech, Bitto'Color.