Class UITexture
java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.util.UITexture
- Direct Known Subclasses:
UIExternalTexture
An immutable
Object
representing a GUI texture that can be drawn on the screen.-
Field Summary
-
Constructor Summary
ConstructorDescriptionUITexture
(net.minecraft.util.Identifier textureId) UITexture
(net.minecraft.util.Identifier textureId, int textureWidth, int textureHeight) UITexture
(net.minecraft.util.Identifier textureId, int textureWidth, int textureHeight, int u, int v, int uvW, int uvH) UITexture
(net.minecraft.util.Identifier textureId, Dimension textureSize, int u, int v, int uvW, int uvH) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
drawTexture
(TDrawContext pencil) Draws theUITexture
over theTDrawContext.currentTarget
element.final void
drawTexture
(net.minecraft.client.gui.DrawContext pencil, int x, int y, int width, int height) Draws theUITexture
in the given UI coordinates.boolean
final net.minecraft.util.Identifier
Deprecated, for removal: This API element is subject to removal in a future version.final net.minecraft.util.Identifier
Returns the texture's resourceIdentifier
.final Dimension
Returns the width and height of the texture.final Rectangle
Returns the UVs of the texture that are rendered on thisTTextureElement
.int
hashCode()
-
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
-
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
-
UITexture
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getTexture
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated. Please usegetTextureID()
instead.- See Also:
-
getTextureID
public final net.minecraft.util.Identifier getTextureID()Returns the texture's resourceIdentifier
. -
getTextureSize
Returns the width and height of the texture. -
getTextureUVs
Returns the UVs of the texture that are rendered on thisTTextureElement
. -
drawTexture
Draws theUITexture
over theTDrawContext.currentTarget
element.- Parameters:
pencil
- TheTDrawContext
.
-
drawTexture
public final void drawTexture(net.minecraft.client.gui.DrawContext pencil, int x, int y, int width, int height) Draws theUITexture
in the given UI coordinates.- Parameters:
pencil
- TheDrawContext
.x
- The UI x coordinate to draw aty
- The UI x coordinate to draw atwidth
- The UI texture horizontal sizeheight
- The UI texture vertical size
-