Posted November 22, 201510 yr In a class that extends GuiContainer, I used this to center my texture.... int x = (this.width-textureWidth)/2;//my texture is a 256x256 texture therefore, textureWidth and textureHeight = 256 int y = (this.height-textureHeight)/2; and this to place it..... this.drawTexturedModalRect(x, y, 0, 0, guiWidth, guiHeight); registering the guihandler in preinit like this NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); But for some reason the texture is being placed at the top left corner at the screen with 3 quarters of the texture being cut off. The center of the texture is being placed at 0, 0 instead of the center of the screen like intended. Yes, I'm new to Forge, but I am not a complete idiot, I used the debugger to figure out that "this.height" and "this.width" equals 0, therefore placing the gui at -128,-128. So why is this happening and can someone tell me how to fix it??? Is the container affecting it? Is it where I'm registering the guihandler?
November 23, 201510 yr http://www.minecraftforge.net/forum/index.php/topic,31297.0.html 1.7.10 is no longer supported by forge, you are on your own.
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.