Class GuiTexture

All Implemented Interfaces:
BackgroundRender, ElementEvents, GuiParent<GuiTexture>, TooltipHandler<GuiTexture>

public class GuiTexture extends GuiElement<GuiTexture> implements BackgroundRender
Created by brandon3055 on 28/08/2023
  • Constructor Details

  • Method Details

    • setMaterial

      public GuiTexture setMaterial(SpriteSupplier spriteSupplier)
    • getSprite

      public SpriteSupplier getSprite()
    • dynamicTexture

      public GuiTexture dynamicTexture()
      Enables dynamic texture resizing though the use of cutting and tiling. Only works with textures that can be cut up and tiled without issues, e.g. background textures or button textures. This method uses the standard border with of 5 pixels on all sides.
    • dynamicTexture

      public GuiTexture dynamicTexture(int textureBorders)
      Enables dynamic texture resizing though the use of cutting and tiling. Only works with textures that can be cut up and tiled without issues, e.g. background textures or button textures. The border parameters indicate the width of border around the texture that must be maintained during the cutting and tiling process. For standardisation purposes the border width should be >= 5
    • dynamicTexture

      public GuiTexture dynamicTexture(@Nullable @Nullable Borders textureBorders)
      Enables dynamic texture resizing though the use of cutting and tiling. Only works with textures that can be cut up and tiled without issues, e.g. background textures or button textures. The border parameters indicate the width of border around the texture that must be maintained during the cutting and tiling process. For standardisation purposes the border width should be >= 5
    • setColour

      public GuiTexture setColour(int colourARGB)
      Allows you to set an argb colour. This colour will be applied when rendering the texture.
    • setColour

      public GuiTexture setColour(Supplier<Integer> colour)
      Allows you to set an argb colour provider. This colour will be applied when rendering the texture.
    • setRotation

      public GuiTexture setRotation(Supplier<Integer> rotation)
      Sets the texture rotation, each integer increment will rotate the texture by 90 degrees. (Not compatible with dynamic textures)
    • setRotation

      public GuiTexture setRotation(int rotation)
      Sets the texture rotation, each integer increment will rotate the texture by 90 degrees. (Not compatible with dynamic textures)
    • renderBehind

      public void renderBehind(net.minecraft.client.gui.GuiGraphics graphics, double mouseX, double mouseY, float partialTicks)
      Description copied from interface: BackgroundRender
      Used to render content behind this elements child elements. When rendering element content, always use the PoseStack available via the provided
      invalid reference
      GuiRender
      Where applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.
      Specified by:
      renderBehind in interface BackgroundRender
      Parameters:
      graphics - Contains gui context information as well as essential render methods/utils including the PoseStack.