java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.util.UITexture
Direct Known Subclasses:
UIExternalTexture

public class UITexture extends Object
An immutable Object representing a GUI texture that can be drawn on the screen.
  • Field Details

    • TEXTURE_UV_DEBUG

      public static final net.minecraft.util.Identifier TEXTURE_UV_DEBUG
  • Constructor Details

    • UITexture

      public UITexture()
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId)
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId, int textureWidth, int textureHeight)
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId, Dimension textureSize)
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId, Dimension textureSize, int u, int v, int uvW, int uvH)
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId, int textureWidth, int textureHeight, int u, int v, int uvW, int uvH)
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId, Rectangle textureUVs)
    • UITexture

      public UITexture(net.minecraft.util.Identifier textureId, Dimension textureSize, Rectangle textureUVs)
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getTexture

      @Deprecated(since="3.6", forRemoval=true) public final net.minecraft.util.Identifier getTexture()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deprecated. Please use getTextureID() instead.
      See Also:
    • getTextureID

      public final net.minecraft.util.Identifier getTextureID()
      Returns the texture's resource Identifier.
    • getTextureSize

      public final Dimension getTextureSize()
      Returns the width and height of the texture.
    • getTextureUVs

      public final Rectangle getTextureUVs()
      Returns the UVs of the texture that are rendered on this TTextureElement.
    • drawTexture

      public final void drawTexture(TDrawContext pencil)
      Draws the UITexture over the TDrawContext.currentTarget element.
      Parameters:
      pencil - The TDrawContext.
    • drawTexture

      public final void drawTexture(net.minecraft.client.gui.DrawContext pencil, int x, int y, int width, int height)
      Draws the UITexture in the given UI coordinates.
      Parameters:
      pencil - The DrawContext.
      x - The UI x coordinate to draw at
      y - The UI x coordinate to draw at
      width - The UI texture horizontal size
      height - The UI texture vertical size