public class TextureAtlasSprite
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private AnimationMetadataSection |
animationMetadata |
protected int |
frameCounter |
protected java.util.List<int[][]> |
framesTextureData |
protected int |
height |
private java.lang.String |
iconName |
protected int[][] |
interpolatedFrameData |
private float |
maxU |
private float |
maxV |
private float |
minU |
private float |
minV |
protected int |
originX |
protected int |
originY |
protected boolean |
rotated |
protected int |
tickCounter |
protected int |
width |
Modifier | Constructor and Description |
---|---|
protected |
TextureAtlasSprite(java.lang.String spriteName) |
Modifier and Type | Method and Description |
---|---|
private void |
allocateFrameTextureData(int index) |
void |
clearFramesTextureData() |
void |
copyFrom(TextureAtlasSprite atlasSpirit) |
void |
generateMipmaps(int level) |
java.util.Collection<ResourceLocation> |
getDependencies() |
int |
getFrameCount() |
int[][] |
getFrameTextureData(int index) |
private static int[][] |
getFrameTextureData(int[][] data,
int rows,
int columns,
int p_147962_3_) |
int |
getIconHeight() |
java.lang.String |
getIconName() |
int |
getIconWidth() |
float |
getInterpolatedU(double u) |
float |
getInterpolatedV(double v) |
float |
getMaxU() |
float |
getMaxV() |
float |
getMinU() |
float |
getMinV() |
int |
getOriginX() |
int |
getOriginY() |
float |
getUnInterpolatedU(float u) |
float |
getUnInterpolatedV(float p_188536_1_) |
boolean |
hasAnimationMetadata() |
boolean |
hasCustomLoader(IResourceManager manager,
ResourceLocation location)
The result of this function determines is the below 'load' function is called, and the
default vanilla loading code is bypassed completely.
|
void |
initSprite(int inX,
int inY,
int originInX,
int originInY,
boolean rotatedIn) |
private int |
interpolateColor(double p_188535_1_,
int p_188535_3_,
int p_188535_4_) |
boolean |
load(IResourceManager manager,
ResourceLocation location,
java.util.function.Function<ResourceLocation,TextureAtlasSprite> textureGetter)
Load the specified resource as this sprite's data.
|
void |
loadSprite(PngSizeInfo sizeInfo,
boolean p_188538_2_) |
void |
loadSpriteFrames(IResource resource,
int mipmaplevels) |
protected static TextureAtlasSprite |
makeAtlasSprite(ResourceLocation spriteResourceLocation) |
private void |
resetSprite() |
void |
setFramesTextureData(java.util.List<int[][]> newFramesTextureData) |
void |
setIconHeight(int newHeight) |
void |
setIconWidth(int newWidth) |
java.lang.String |
toString() |
void |
updateAnimation() |
private void |
updateAnimationInterpolated() |
private final java.lang.String iconName
protected java.util.List<int[][]> framesTextureData
protected int[][] interpolatedFrameData
private AnimationMetadataSection animationMetadata
protected boolean rotated
protected int originX
protected int originY
protected int width
protected int height
private float minU
private float maxU
private float minV
private float maxV
protected int frameCounter
protected int tickCounter
protected static TextureAtlasSprite makeAtlasSprite(ResourceLocation spriteResourceLocation)
public void initSprite(int inX, int inY, int originInX, int originInY, boolean rotatedIn)
public void copyFrom(TextureAtlasSprite atlasSpirit)
public int getOriginX()
public int getOriginY()
public int getIconWidth()
public int getIconHeight()
public float getMinU()
public float getMaxU()
public float getInterpolatedU(double u)
public float getUnInterpolatedU(float u)
public float getMinV()
public float getMaxV()
public float getInterpolatedV(double v)
public float getUnInterpolatedV(float p_188536_1_)
public java.lang.String getIconName()
public void updateAnimation()
private void updateAnimationInterpolated()
private int interpolateColor(double p_188535_1_, int p_188535_3_, int p_188535_4_)
public int[][] getFrameTextureData(int index)
public int getFrameCount()
public void setIconWidth(int newWidth)
public void setIconHeight(int newHeight)
public void loadSprite(PngSizeInfo sizeInfo, boolean p_188538_2_) throws java.io.IOException
java.io.IOException
public void loadSpriteFrames(IResource resource, int mipmaplevels) throws java.io.IOException
java.io.IOException
public void generateMipmaps(int level)
private void allocateFrameTextureData(int index)
private static int[][] getFrameTextureData(int[][] data, int rows, int columns, int p_147962_3_)
public void clearFramesTextureData()
public boolean hasAnimationMetadata()
public void setFramesTextureData(java.util.List<int[][]> newFramesTextureData)
private void resetSprite()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location)
manager
- Main resource managerlocation
- File resource locationpublic boolean load(IResourceManager manager, ResourceLocation location, java.util.function.Function<ResourceLocation,TextureAtlasSprite> textureGetter)
manager
- Main resource managerlocation
- File resource locationtextureGetter
- accessor for dependencies. All of them will be loaded before this onepublic java.util.Collection<ResourceLocation> getDependencies()