Package com.samsthenerd.inline.utils
Class URLTextureUtils
java.lang.Object
com.samsthenerd.inline.utils.URLTextureUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.util.Pair<IntPair, SpriteUVLens> getTextureInfo(net.minecraft.util.Identifier textureId) static net.minecraft.util.IdentifierloadTextureFromURL(String urlStr, net.minecraft.util.Identifier textureId) static net.minecraft.util.Pair<IntPair, SpriteUVLens> readGif(net.minecraft.util.Identifier loc, ByteBuffer buf) static net.minecraft.util.Pair<IntPair, SpriteUVLens> readImageSTB(net.minecraft.util.Identifier loc, ByteBuffer buf) static net.minecraft.util.Pair<IntPair, SpriteUVLens> readSVG(net.minecraft.util.Identifier loc, ByteBuffer svgXmlBuf, BiFunction<Float, Float, Integer> sizeFunc) rasterizes an svg saving the result in loaded_textures
-
Constructor Details
-
URLTextureUtils
public URLTextureUtils()
-
-
Method Details
-
loadTextureFromURL
@Nullable public static net.minecraft.util.Identifier loadTextureFromURL(String urlStr, net.minecraft.util.Identifier textureId) -
getTextureInfo
@Nullable public static net.minecraft.util.Pair<IntPair,SpriteUVLens> getTextureInfo(net.minecraft.util.Identifier textureId) -
readGif
public static net.minecraft.util.Pair<IntPair,SpriteUVLens> readGif(net.minecraft.util.Identifier loc, ByteBuffer buf) throws IOException - Throws:
IOException
-
readImageSTB
public static net.minecraft.util.Pair<IntPair,SpriteUVLens> readImageSTB(net.minecraft.util.Identifier loc, ByteBuffer buf) throws IOException - Throws:
IOException
-
readSVG
public static net.minecraft.util.Pair<IntPair,SpriteUVLens> readSVG(net.minecraft.util.Identifier loc, ByteBuffer svgXmlBuf, BiFunction<Float, Float, Integer> sizeFunc) rasterizes an svg saving the result in loaded_textures- Parameters:
loc- loaded_textures keysvgXmlBuf- svg contentsizeFunc- takes svg width, svg height -> (texture width)
-