Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Buttons not Scaling/Positioning correctly


cclloyd9785
 Share

Recommended Posts

I have a custom chest, and want to draw a few buttons on the GuiContainer, above the item inventory.  But it seems that the buttons aren't scaling with the chest UI like they're supposed to.  They seem to be positioning themselves completely independent.  If I put their x/y at 5,5 it's at the vert top left of the screen instead of the container.

 

GuiContainer:  http://pastebin.com/VU0fCiah

Background Image: 

Link to comment
Share on other sites

Ok so I moved the statements with the buttons to the constructor so they're only added to the list once.

 

How do I make them draw at that point?  I can't cycle through the list like an array, so I tried

 

((GuiButton) this.buttonList.get(i)).drawButton(Minecraft.getMinecraft(), mouseX, mouseY);

but that didn't draw them.

 

And how did the coordinates not make sense?  Half the width minus 20 would put it a little before the center of the screen.

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.