Class TextureKey

All Implemented Interfaces:
Savable, Cloneable
Direct Known Subclasses:
ContentTextureKey

public class TextureKey extends AssetKey<Texture>
Used to load textures from image files such as JPG or PNG. Note that texture loaders actually load the asset as an Image object, which is then converted to a Texture in the TextureProcessor.postProcess(com.jme3.asset.AssetKey, java.lang.Object) method. Since textures are cloneable smart assets, the texture stored in the cache will be collected when all clones of the texture become unreachable.
  • Constructor Details

    • TextureKey

      public TextureKey(String name, boolean flipY)
    • TextureKey

      public TextureKey(String name)
    • TextureKey

      public TextureKey()
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class AssetKey<Texture>
    • getCacheType

      public Class<? extends AssetCache> getCacheType()
      Overrides:
      getCacheType in class AssetKey<Texture>
      Returns:
      The preferred cache class for this asset type. Specify "null" if caching is to be disabled. By default, the SimpleAssetCache is returned.
    • getProcessorType

      public Class<? extends AssetProcessor> getProcessorType()
      Overrides:
      getProcessorType in class AssetKey<Texture>
      Returns:
      The preferred processor type for this asset type. Specify "null" if no processing is required.
    • isFlipY

      public boolean isFlipY()
    • setFlipY

      public void setFlipY(boolean flipY)
    • getAnisotropy

      public int getAnisotropy()
    • setAnisotropy

      public void setAnisotropy(int anisotropy)
    • isGenerateMips

      public boolean isGenerateMips()
    • setGenerateMips

      public void setGenerateMips(boolean generateMips)
    • getTextureTypeHint

      public Texture.Type getTextureTypeHint()
      The type of texture expected to be returned.
      Returns:
      type of texture expected to be returned.
    • setTextureTypeHint

      public void setTextureTypeHint(Texture.Type textureTypeHint)
      Hints the loader as to which type of texture is expected.
      Parameters:
      textureTypeHint - The type of texture expected to be loaded.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class AssetKey<Texture>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AssetKey<Texture>
    • write

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class AssetKey<Texture>
      Throws:
      IOException
    • read

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class AssetKey<Texture>
      Throws:
      IOException