Posted April 10, 20178 yr 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. As you can see the texture isn't the right or something like that and because of that it is stretched. Edited April 10, 20178 yr by Kokkie Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
April 10, 20178 yr 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.
April 10, 20178 yr Author the texture is in assets.dgm.textures.gui Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
April 10, 20178 yr In that case: 1 hour ago, Jay Avery said: If it's not 256x256, you need to use Gui#drawModalRectWithCustomSizedTexture instead of Gui#drawTexturedModalRect
April 11, 20178 yr Author It is 256x256... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
April 11, 20178 yr 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 April 11, 20178 yr by Kokkie typo Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
April 11, 20178 yr Author Now, in my store, the buttons are all invisible (also the normal buttons (GuiButtonExt)) Just found the problem... Edited April 11, 20178 yr by Kokkie 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.