Jump to content

Recommended Posts

Posted

no errors are getting put out but when i try to open up the gui for my block it gives an odd background.

 

gui code:

 

  Reveal hidden contents

 

 

gui handler:

 

  Reveal hidden contents

 

 

here is the image of what shows up:

 

  Reveal hidden contents

 

 

the gui image is currently stored with the gui code and gui handler. if theres anything else you need me to share let me know.

Posted

Here is your mistake:

@Override
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
            [b]this.mc.renderEngine.getTexture("/gui/oreMixer.png");[/b]
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            int x = (width - xSize) / 2;
            int y = (height - ySize) / 2;
            this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    }

When you are getting the texture you need to use its full path,like so:

this.mc.renderEngine.getTexture("mods/YourModID/textures/gui/oreMixer.png");

Posted

that didnt work, its still shows the same image that i already shared. though i did notice it gave an error this time so heres the forge logs

 

 

  Reveal hidden contents

 

Posted

ok i took a look at this thread and saw that they had the code

this.mc.renderEngine.bindTexture

instead of

this.mc.renderEngine.getTexture

the difference being bind and get thank you for your help though.

Posted

but now im having a new problem where its not displaying the full texture, ive tried changing many of the variables that have to deal with size but the display doesnt change

 

gui code again:

 

  Reveal hidden contents

 

 

image of screen:

 

  Reveal hidden contents

 

 

what the gui should look like:

 

  Reveal hidden contents

 

Posted

Anyone have any ideas about this new problem? The texture is suppose to be 182xSize 172ySize but it is requiring the x to be 225 to display the full texture on the x and everything just seems stretched.

Posted

Ive already tries that, its was requiring 225 for the x to show the full texture on the x it seems that something is trying to scale the texture to larger than it should be.

Posted

Its a problem with your texture file not with your code. The gui textures have to be 256 by 256 even if you don't use all of the space. I actually had the same problem as you and that was how I solved it. When the texture file isn't the right size I believe Minecraft will try to scale it up to the right resolution hence the scaling. Hope this helped!

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.

Announcements



×
×
  • Create New...

Important Information

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