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

    • GuiTexture

      public GuiTexture(@NotNull @NotNull GuiParent<?> parent)
      Parameters:
      parent - parent GuiParent.
    • GuiTexture

      public GuiTexture(@NotNull @NotNull GuiParent<?> parent, Supplier<Material> supplier)
    • GuiTexture

      public GuiTexture(@NotNull @NotNull GuiParent<?> parent, Material material)
  • Method Details

    • setMaterial

      public GuiTexture setMaterial(Supplier<Material> supplier)
    • setMaterial

      public GuiTexture setMaterial(Material material)
    • getMaterial

      @Nullable public @Nullable Material getMaterial()
    • 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(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)
    • renderBackground

      public void renderBackground(GuiRender render, 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 GuiRender Where applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.
      Specified by:
      renderBackground in interface BackgroundRender
      Parameters:
      render - Contains gui context information as well as essential render methods/utils including the PoseStack.