Class URLTextureUtils

java.lang.Object
com.samsthenerd.inline.utils.URLTextureUtils

public class URLTextureUtils extends Object
  • 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 key
      svgXmlBuf - svg content
      sizeFunc - takes svg width, svg height -> (texture width)