public class WSprite extends WWidget
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentFrame |
protected long |
currentFrameTime |
protected Texture[] |
frames |
protected int |
frameTime |
protected long |
lastFrame |
protected boolean |
singleImage |
protected int |
tint |
| Constructor and Description |
|---|
WSprite(net.minecraft.util.Identifier image)
Create a new sprite with a single image.
|
WSprite(net.minecraft.util.Identifier image,
float u1,
float v1,
float u2,
float v2)
Create a new sprite with a single image and custom UV values.
|
WSprite(int frameTime,
net.minecraft.util.Identifier... frames)
Create a new animated sprite.
|
WSprite(int frameTime,
Texture... frames)
Create a new animated sprite.
|
WSprite(Texture texture)
Create a new sprite with a single image.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canResize()
Checks whether this widget can be resized using
WWidget.setSize(int, int). |
void |
paint(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY)
Paints this widget.
|
protected void |
paintFrame(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
Texture texture)
Paints a single frame for this sprite.
|
WSprite |
setFrames(net.minecraft.util.Identifier... frames)
Sets the animation frames of this sprite.
|
WSprite |
setFrames(Texture... frames)
Sets the animation frames of this sprite.
|
WSprite |
setImage(net.minecraft.util.Identifier image)
Sets the image of this sprite.
|
WSprite |
setImage(Texture image)
Sets the image of this sprite.
|
WSprite |
setOpaqueTint(int tint)
Sets the tint for this sprite to the following opaque color.
|
WSprite |
setTint(int tint)
Sets the tint for this sprite to the following color-with-alpha.
|
WSprite |
setUv(float u1,
float v1,
float u2,
float v2)
Sets the UV values of this sprite.
|
addPainters, addTooltip, canFocus, createPeers, cycleFocus, getAbsoluteX, getAbsoluteY, getHeight, getHost, getParent, getWidth, getX, getY, hit, isActivationKey, isFocused, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onHidden, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, onShown, releaseFocus, renderTooltip, requestFocus, setHost, setLocation, setParent, setSize, tick, validateprotected int currentFrame
protected long currentFrameTime
protected Texture[] frames
protected int frameTime
protected long lastFrame
protected boolean singleImage
protected int tint
public WSprite(Texture texture)
texture - The image texture to display.public WSprite(net.minecraft.util.Identifier image)
image - The location of the image to display.public WSprite(net.minecraft.util.Identifier image,
float u1,
float v1,
float u2,
float v2)
image - The location of the image to display.u1 - the left edge of the texturev1 - the top edge of the textureu2 - the right edge of the texturev2 - the bottom edge of the texturepublic WSprite(int frameTime,
net.minecraft.util.Identifier... frames)
frameTime - How long in milliseconds to display for. (1 tick = 50 ms)frames - The locations of the frames of the animation.public WSprite(int frameTime,
Texture... frames)
frameTime - How long in milliseconds to display for. (1 tick = 50 ms)frames - The locations of the frames of the animation.public WSprite setImage(net.minecraft.util.Identifier image)
image - the new imagepublic WSprite setFrames(net.minecraft.util.Identifier... frames)
frames - the framespublic WSprite setImage(Texture image)
image - the new imagepublic WSprite setFrames(Texture... frames)
frames - the framespublic WSprite setTint(int tint)
setOpaqueTint(int) instead.tint - the new tintpublic WSprite setOpaqueTint(int tint)
tint - the new tintpublic WSprite setUv(float u1, float v1, float u2, float v2)
u1 - the left edge of the texturev1 - the top edge of the textureu2 - the right edge of the texturev2 - the bottom edge of the texturepublic boolean canResize()
WWidgetWWidget.setSize(int, int).@Environment(value=CLIENT)
public void paint(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY)
WWidget@Environment(value=CLIENT)
protected void paintFrame(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
Texture texture)
matrices - the rendering matrix stackx - the X coordinate to draw it aty - the Y coordinate to draw it attexture - the texture to draw