Jump to content

Recommended Posts

Posted (edited)

Hello, I've made a custom button with textures for my money system. My code is on my github (https://github.com/KokkieBeer/DeGeweldigeMod). The button is located in com.Egietje.degeweldigemod.gui.button.

5c16f2a7646b6fdd93bf15a6c7708465.png

As you can see the texture isn't the right or something like that and because of that it is stretched.

Edited by Kokkie

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

Posted

I can't find your texture image on your github. What size is the image? If it's not 256x256, you need to use Gui#drawModalRectWithCustomSizedTexture instead of Gui#drawTexturedModalRect.

Posted (edited)

Sorry, it's the older one, my newer one is... I changed the code to this:

	public GuiButtonWithImage(int buttonID, int xPos, int yPos, int xOff,int yOff, int type, boolean bank) {
		super(buttonID, xPos, yPos, 20, 20, "");
		textureOffsetX = xOff;
		textureOffsetY = yOff;
		if (bank) {
			this.type = type;
		}
	}

Now it does work...

Edited by Kokkie
typo

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

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.