#Need to pass a render layer when drawing a Gui Texture

6 messages · Page 1 of 1 (latest)

random fern
#

I am porting from 1.21.1 to 1.21.2 and was previously using a drawGuiTexture function to draw my custom button in the inventory. Now that method requires a Function<Identifier, RenderLayer> renderLayers parameter as well. I am passing it that parameter by doing the following:

buttonTexture -> RenderLayer.getGui()

No errors are being thrown, my button just looks incorrect

#

I am unfamiliar with render layers, how can I fix this?

minor relic
#

Hey, I have the same problem but with the drawTexture method

#

Did you find a fix

glacial violet
#

you dont seem to be using your texture when getting the render layer

#

buttonTexture -> RenderLayer.getGui()
is the same as

public static RenderLayer getMyRenderLayer(Identifier buttonTexture) {
  return RenderLayer.getGui();
}