@Environment(value=CLIENT) public class Sprite extends Object implements AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
Sprite.Info |
(package private) class |
Sprite.Interpolation |
Modifier and Type | Field and Description |
---|---|
private AnimationResourceMetadata |
animationMetadata |
private SpriteAtlasTexture |
atlas |
private int |
frameIndex |
private int |
frameTicks
The tick position within the current frame.
|
private int[] |
frameXs |
private int[] |
frameYs |
protected NativeImage[] |
images |
private Sprite.Info |
info |
private Sprite.Interpolation |
interpolation |
private float |
uMax |
private float |
uMin |
private float |
vMax |
private float |
vMin |
private int |
x |
private int |
y |
Modifier | Constructor and Description |
---|---|
protected |
Sprite(SpriteAtlasTexture spriteAtlasTexture,
Sprite.Info info,
int maxLevel,
int atlasWidth,
int atlasHeight,
int x,
int y,
NativeImage nativeImage) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
float |
getAnimationFrameDelta() |
SpriteAtlasTexture |
getAtlas() |
int |
getFrameCount() |
private float |
getFrameDeltaFactor() |
float |
getFrameU(double frame) |
float |
getFrameV(double frame) |
int |
getHeight() |
Identifier |
getId() |
float |
getMaxU() |
float |
getMaxV() |
float |
getMinU() |
float |
getMinV() |
VertexConsumer |
getTextureSpecificVertexConsumer(VertexConsumer vertexConsumer) |
int |
getWidth() |
boolean |
isAnimated() |
boolean |
isPixelTransparent(int frame,
int x,
int y) |
void |
tickAnimation() |
String |
toString() |
void |
upload() |
private void |
upload(int frame) |
private void |
upload(int frameX,
int frameY,
NativeImage[] output) |
private final SpriteAtlasTexture atlas
private final Sprite.Info info
private final AnimationResourceMetadata animationMetadata
protected final NativeImage[] images
private final int[] frameXs
private final int[] frameYs
@Nullable private final Sprite.Interpolation interpolation
private final int x
private final int y
private final float uMin
private final float uMax
private final float vMin
private final float vMax
private int frameIndex
private int frameTicks
protected Sprite(SpriteAtlasTexture spriteAtlasTexture, Sprite.Info info, int maxLevel, int atlasWidth, int atlasHeight, int x, int y, NativeImage nativeImage)
private void upload(int frame)
private void upload(int frameX, int frameY, NativeImage[] output)
public int getWidth()
public int getHeight()
public float getMinU()
public float getMaxU()
public float getFrameU(double frame)
public float getMinV()
public float getMaxV()
public float getFrameV(double frame)
public Identifier getId()
public SpriteAtlasTexture getAtlas()
public int getFrameCount()
public void close()
close
in interface AutoCloseable
public boolean isPixelTransparent(int frame, int x, int y)
public void upload()
private float getFrameDeltaFactor()
public float getAnimationFrameDelta()
public void tickAnimation()
public boolean isAnimated()
public VertexConsumer getTextureSpecificVertexConsumer(VertexConsumer vertexConsumer)