public class TextureAtlasSprite
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
frameCounter |
protected java.util.List<int[][]> |
framesTextureData |
protected int |
height |
protected int[][] |
interpolatedFrameData |
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 |
---|---|
void |
clearFramesTextureData() |
void |
copyFrom(TextureAtlasSprite atlasSpirit) |
void |
generateMipmaps(int level) |
int |
getFrameCount() |
int[][] |
getFrameTextureData(int index) |
int |
getIconHeight()
Returns the height of the icon, in pixels.
|
java.lang.String |
getIconName() |
int |
getIconWidth()
Returns the width of the icon, in pixels.
|
float |
getInterpolatedU(double u)
Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax.
|
float |
getInterpolatedV(double v)
Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax.
|
float |
getMaxU()
Returns the maximum U coordinate to use when rendering with this icon.
|
float |
getMaxV()
Returns the maximum V coordinate to use when rendering with this icon.
|
float |
getMinU()
Returns the minimum U coordinate to use when rendering with this icon.
|
float |
getMinV()
Returns the minimum V coordinate to use when rendering with this icon.
|
int |
getOriginX()
Returns the X position of this icon on its texture sheet, in pixels.
|
int |
getOriginY()
Returns the Y position of this icon on its texture sheet, in pixels.
|
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) |
boolean |
load(IResourceManager manager,
ResourceLocation location)
Load the specified resource as this sprite's data.
|
void |
loadSprite(java.awt.image.BufferedImage[] images,
AnimationMetadataSection meta) |
protected static TextureAtlasSprite |
makeAtlasSprite(ResourceLocation spriteResourceLocation) |
void |
setFramesTextureData(java.util.List<int[][]> newFramesTextureData) |
void |
setIconHeight(int newHeight) |
void |
setIconWidth(int newWidth) |
static void |
setLocationNameClock(java.lang.String clockName) |
static void |
setLocationNameCompass(java.lang.String compassName) |
java.lang.String |
toString() |
void |
updateAnimation() |
protected java.util.List<int[][]> framesTextureData
protected int[][] interpolatedFrameData
protected boolean rotated
protected int originX
protected int originY
protected int width
protected int height
protected int frameCounter
protected int tickCounter
protected static TextureAtlasSprite makeAtlasSprite(ResourceLocation spriteResourceLocation)
public static void setLocationNameClock(java.lang.String clockName)
public static void setLocationNameCompass(java.lang.String compassName)
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 getMinV()
public float getMaxV()
public float getInterpolatedV(double v)
public java.lang.String getIconName()
public void updateAnimation()
public int[][] getFrameTextureData(int index)
public int getFrameCount()
public void setIconWidth(int newWidth)
public void setIconHeight(int newHeight)
public void loadSprite(java.awt.image.BufferedImage[] images, AnimationMetadataSection meta) throws java.io.IOException
java.io.IOException
public void generateMipmaps(int level)
public void clearFramesTextureData()
public boolean hasAnimationMetadata()
public void setFramesTextureData(java.util.List<int[][]> newFramesTextureData)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location)
manager
- location
- public boolean load(IResourceManager manager, ResourceLocation location)
manager
- Main resource managerlocation
- File resource location