@Environment(value=CLIENT) public class SpriteAtlasTexture extends AbstractTexture implements TextureTickListener
Modifier and Type | Class and Description |
---|---|
static class |
SpriteAtlasTexture.Data |
Modifier and Type | Field and Description |
---|---|
private List<Sprite> |
animatedSprites |
static Identifier |
BLOCK_ATLAS_TEXTURE
Deprecated.
|
private Identifier |
id |
private static Logger |
LOGGER |
private int |
maxTextureSize |
static Identifier |
PARTICLE_ATLAS_TEXTURE
Deprecated.
|
private Map<Identifier,Sprite> |
sprites |
private Set<Identifier> |
spritesToLoad |
bilinear, glId, mipmap
Constructor and Description |
---|
SpriteAtlasTexture(Identifier identifier) |
Modifier and Type | Method and Description |
---|---|
void |
applyTextureFilter(SpriteAtlasTexture.Data data) |
void |
clear() |
Identifier |
getId() |
Sprite |
getSprite(Identifier id) |
private Identifier |
getTexturePath(Identifier identifier) |
void |
load(ResourceManager manager) |
private Sprite |
loadSprite(ResourceManager container,
Sprite.Info info,
int atlasWidth,
int atlasHeight,
int maxLevel,
int x,
int y) |
private Collection<Sprite.Info> |
loadSprites(ResourceManager resourceManager,
Set<Identifier> ids) |
private List<Sprite> |
loadSprites(ResourceManager resourceManager,
TextureStitcher textureStitcher,
int maxLevel) |
SpriteAtlasTexture.Data |
stitch(ResourceManager resourceManager,
Stream<Identifier> idStream,
Profiler profiler,
int mipmapLevel) |
void |
tick() |
void |
tickAnimatedSprites() |
void |
upload(SpriteAtlasTexture.Data data) |
bindTexture, clearGlId, close, getGlId, registerTexture, setFilter
private static final Logger LOGGER
@Deprecated public static final Identifier BLOCK_ATLAS_TEXTURE
@Deprecated public static final Identifier PARTICLE_ATLAS_TEXTURE
private final Set<Identifier> spritesToLoad
private final Map<Identifier,Sprite> sprites
private final Identifier id
private final int maxTextureSize
public SpriteAtlasTexture(Identifier identifier)
public void load(ResourceManager manager) throws IOException
load
in class AbstractTexture
IOException
public void upload(SpriteAtlasTexture.Data data)
public SpriteAtlasTexture.Data stitch(ResourceManager resourceManager, Stream<Identifier> idStream, Profiler profiler, int mipmapLevel)
private Collection<Sprite.Info> loadSprites(ResourceManager resourceManager, Set<Identifier> ids)
private List<Sprite> loadSprites(ResourceManager resourceManager, TextureStitcher textureStitcher, int maxLevel)
@Nullable private Sprite loadSprite(ResourceManager container, Sprite.Info info, int atlasWidth, int atlasHeight, int maxLevel, int x, int y)
private Identifier getTexturePath(Identifier identifier)
public void tickAnimatedSprites()
public void tick()
tick
in interface TextureTickListener
public Sprite getSprite(Identifier id)
public void clear()
public Identifier getId()
public void applyTextureFilter(SpriteAtlasTexture.Data data)