Class Texture
java.lang.Object
io.github.cottonmc.cotton.gui.widget.data.Texture
Represents a texture for a widget.
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionnet.minecraft.util.IdentifierThe image of this texture.floatThe UV coordinates of this texture, between 0 and 1.floatThe UV coordinates of this texture, between 0 and 1.floatThe UV coordinates of this texture, between 0 and 1.floatThe UV coordinates of this texture, between 0 and 1. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
image
public final net.minecraft.util.Identifier imageThe image of this texture. -
u1
public final float u1The UV coordinates of this texture, between 0 and 1. -
v1
public final float v1The UV coordinates of this texture, between 0 and 1. -
u2
public final float u2The UV coordinates of this texture, between 0 and 1. -
v2
public final float v2The UV coordinates of this texture, between 0 and 1.
-
-
Constructor Details
-
Texture
public Texture(net.minecraft.util.Identifier image)Constructs a new texture that uses the full image.- Parameters:
image- the image- Throws:
NullPointerException- if the image is null
-
Texture
public Texture(net.minecraft.util.Identifier image, float u1, float v1, float u2, float v2)Constructs a new texture with custom UV values.- Parameters:
image- the imageu1- the left U coordinatev1- the top V coordinateu2- the right U coordinatev2- the bottom V coordinate- Throws:
NullPointerException- if the image is null
-
-
Method Details
-
withUv
Creates a new texture with different UV values.- Parameters:
u1- the left U coordinatev1- the top V coordinateu2- the right U coordinatev2- the bottom V coordinate- Returns:
- the created texture
-