Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

In that case:

1 hour ago, Jay Avery said:

If it's not 256x256, you need to use Gui#drawModalRectWithCustomSizedTexture instead of Gui#drawTexturedModalRect

  • Author

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.