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

[1.8.8] Gui Texture drawn wrong


Recommended Posts

It appears more than once, this is with the texture size being 512x512 (Same thing occurs when cropped to the proper size of 372x166). Anyone that can help?


@Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
	GlStateManager.color(1, 1, 1, 1);
	drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize); //xSize being 372, ySize being 166



Link to comment
Share on other sites

drawTexturedModalRect uses a 256 x 256 texture.


If you want to load a different size you'll need to make your own draw function. scratch that.

0.00390625F is 1 / 256



Ernio is correct, drawModalRectWithCustomSizedTexture is what you want.



For my mods in-game wiki I needed scaling, flipping, and custom sizes; so I coded a function that did everything and completely forgot Minecraft had more then drawTexturedModalRect

(not sure when drawScaledCustomSizeModalRect appeared but I'm sure it wasn't there before, I could have used it for about 2/3rds of my images)

Link to comment
Share on other sites

If you want to load a different size you'll need to make your own draw function.

0.00390625F is 1 / 256


I'd like to note that there is alredy method that has size args (...withCustomSize() or something).


Since you are drawing container, I'd also like to note: (might come in handy) :D


1.7.10 is no longer supported by forge, you are on your own.

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.

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.


  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm new to modding and I want to do this. What class would I put that in?
    • That is a different crash report. Please post the debug.log file from the logs folder.
    • [22Jan.2022 18:41:22.485] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: 'net.minecraft.nbt.CompoundTag net.minecraft.world.level.block.entity.SignBlockEntity.save(net.minecraft.nbt.CompoundTag)'     Index: 4     Listeners:         0: HIGH         1: ASM: class dev.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         2: NORMAL         3: ASM: cyclopscore onServerStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         4: ASM: chanceCubes.CCubesCore@5b77fda6 serverStart(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         5: ASM: mods.waterstrainer.event.EventServerStarting@2dc1913f onServerStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         6: ASM: com.song.castle_in_the_sky.CastleInTheSky@1f8c253d onServerStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         7: ASM: se.mickelus.tetra.TetraMod@203a3089 serverStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         8: net.minecraftforge.eventbus.EventBus$$Lambda$4325/0x0000000800c57770@71737087         9: ASM: de.teamlapen.vampirism.VampirismMod@1213b1b onServerStart(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         10: net.minecraftforge.eventbus.EventBus$$Lambda$4325/0x0000000800c57770@1a894d2d         11: net.minecraftforge.eventbus.EventBus$$Lambda$4325/0x0000000800c57770@3deb329 java.lang.NoSuchMethodError: 'net.minecraft.nbt.CompoundTag net.minecraft.world.level.block.entity.SignBlockEntity.save(net.minecraft.nbt.CompoundTag)'     at TRANSFORMER/chancecubes@1.18.1-     at TRANSFORMER/chancecubes@1.18.1-     at net.minecraftforge.eventbus.ASMEventHandler_101_CCubesCore_serverStart_ServerStartingEvent.invoke(.dynamic)     at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)     at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)     at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)     at TRANSFORMER/forge@39.0.56/net.minecraftforge.server.ServerLifecycleHooks.handleServerStarting(ServerLifecycleHooks.java:102)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.base/java.lang.reflect.Method.invoke(Method.java:568)     at TRANSFORMER/net.optifine/net.optifine.reflect.Reflector.callBoolean(Reflector.java:702)     at TRANSFORMER/minecraft@1.18.1/net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:90)     at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:644)     at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258)     at java.base/java.lang.Thread.run(Thread.java:833) [22Jan.2022 18:41:22.509] [Server thread/DEBUG] [mixin/]: Mixing MixinChunkSerializer from architectury.mixins.json into net.minecraft.world.level.chunk.storage.ChunkSerializer [22Jan.2022 18:41:28.076] [Server thread/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing serverconfig directory : C:\Users\UTW\AppData\Roaming\.minecraft\saves\New World\serverconfig [22Jan.2022 18:41:28.076] [Server thread/DEBUG] [net.minecraftforge.fml.config.ConfigTracker/CONFIG]: Unloading configs type SERVER Sry if its not the right one, im pretty new at Forge
    • I have a modded server that worked before I changed the config for SereneSeasons (made the seasons longer and turned off offline season progression). Now it just gives said error message, even after reverting the changes.
  • Topics

  • Who's Online (See full list)

  • Create New...

Important Information

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