com.jme3.asset
インタフェース AssetManager


public interface AssetManager

AssetManager provides an interface for managing the data assets of a jME3 application.


メソッドの概要
<T> T
loadAsset(AssetKey<T> key)
          Load an asset from a key, the asset will be located by one of the AssetLocator implementations provided in the registerLocator(java.lang.String, java.lang.Class) call.
 java.lang.Object loadAsset(java.lang.String name)
          Load a named asset by name, calling this method is the same as calling loadAsset(new AssetKey(name)).
 AudioData loadAudio(AudioKey key)
          Load audio file, supported types are WAV or OGG.
 AudioData loadAudio(java.lang.String name)
          Load audio file, supported types are WAV or OGG.
 BitmapFont loadFont(java.lang.String name)
          Load a font file.
 Material loadMaterial(java.lang.String name)
          Load a material (J3M) file.
 Spatial loadModel(ModelKey key)
          Loads a named model.
 Spatial loadModel(java.lang.String name)
          Loads a named model.
 Shader loadShader(ShaderKey key)
          Loads shader file(s), shouldn't be used by end-user in most cases.
 Texture loadTexture(java.lang.String name)
          Loads texture file, supported types are BMP, JPG, PNG, GIF, TGA and DDS.
 Texture loadTexture(TextureKey key)
          Loads texture file, supported types are BMP, JPG, PNG, GIF, TGA and DDS.
 AssetInfo locateAsset(AssetKey<?> key)
          Manually locates an asset with the given AssetKey.
 void registerLoader(java.lang.Class<? extends AssetLoader> loaderClass, java.lang.String... extensions)
           
 void registerLoader(java.lang.String loaderClassName, java.lang.String... extensions)
          Registers a loader for the given extensions.
 void registerLocator(java.lang.String rootPath, java.lang.Class<? extends AssetLocator> locatorClass)
          Registers the given locator class for locating assets with this AssetManager.
 void registerLocator(java.lang.String rootPath, java.lang.String locatorClassName)
          Registers an AssetLocator by using a class name, instead of a class instance.
 void setAssetEventListener(AssetEventListener listener)
          Set an AssetEventListener to receive events from this AssetManager.
 

メソッドの詳細

registerLoader

void registerLoader(java.lang.String loaderClassName,
                    java.lang.String... extensions)
Registers a loader for the given extensions.

パラメータ:
loaderClassName -
extensions -

registerLocator

void registerLocator(java.lang.String rootPath,
                     java.lang.String locatorClassName)
Registers an AssetLocator by using a class name, instead of a class instance. See the registerLocator(java.lang.String, java.lang.Class) method for more information.

パラメータ:
rootPath - The root path from which to locate assets, implementation dependent.
locatorClassName - The full class name of the AssetLocator implementation.

registerLoader

void registerLoader(java.lang.Class<? extends AssetLoader> loaderClass,
                    java.lang.String... extensions)
パラメータ:
loaderClass -
extensions -

registerLocator

void registerLocator(java.lang.String rootPath,
                     java.lang.Class<? extends AssetLocator> locatorClass)
Registers the given locator class for locating assets with this AssetManager. AssetLocators are invoked in the order they were registered, to locate the asset by the AssetKey. Once an AssetLocator returns a non-null AssetInfo, it is sent to the AssetLoader to load the asset.

パラメータ:
rootPath - Specifies the root path from which to locate assets for the given AssetLocator. The purpose of this parameter depends on the type of the AssetLocator.
locatorClass - The class type of the AssetLocator to register.
関連項目:
AssetLocator.setRootPath(java.lang.String), AssetLocator.locate(com.jme3.asset.AssetManager, com.jme3.asset.AssetKey)

setAssetEventListener

void setAssetEventListener(AssetEventListener listener)
Set an AssetEventListener to receive events from this AssetManager. There can only be one AssetEventListener associated with an AssetManager

パラメータ:
listener -

locateAsset

AssetInfo locateAsset(AssetKey<?> key)
Manually locates an asset with the given AssetKey. This method should be used for debugging or internal uses.
The call will attempt to locate the asset by invoking the AssetLocator that are registered with this AssetManager, in the same way that the loadAsset(com.jme3.asset.AssetKey) method locates assets.

パラメータ:
key - The AssetKey to locate.
戻り値:
The AssetInfo object returned from the AssetLocator that located the asset, or null if the asset cannot be located.

loadAsset

<T> T loadAsset(AssetKey<T> key)
Load an asset from a key, the asset will be located by one of the AssetLocator implementations provided in the registerLocator(java.lang.String, java.lang.Class) call. If located successfully, it will be loaded via the the appropriate AssetLoader implementation based on the file's extension, as specified in the call registerLoader(java.lang.Class, java.lang.String[]).

型パラメータ:
T - The object type that will be loaded from the AssetKey instance.
パラメータ:
key - The AssetKey
戻り値:
The loaded asset, or null if it was failed to be located or loaded.

loadAsset

java.lang.Object loadAsset(java.lang.String name)
Load a named asset by name, calling this method is the same as calling loadAsset(new AssetKey(name)).

パラメータ:
name - The name of the asset to load.
戻り値:
The loaded asset, or null if failed to be loaded.
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadTexture

Texture loadTexture(TextureKey key)
Loads texture file, supported types are BMP, JPG, PNG, GIF, TGA and DDS.

パラメータ:
key - The TextureKey to use for loading.
戻り値:
The loaded texture, or null if failed to be loaded.
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadTexture

Texture loadTexture(java.lang.String name)
Loads texture file, supported types are BMP, JPG, PNG, GIF, TGA and DDS.

パラメータ:
name - The name of the texture to load.
戻り値:
The texture that was loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadAudio

AudioData loadAudio(AudioKey key)
Load audio file, supported types are WAV or OGG.

パラメータ:
key -
戻り値:
The audio data loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadAudio

AudioData loadAudio(java.lang.String name)
Load audio file, supported types are WAV or OGG. The file is loaded without stream-mode.

パラメータ:
name -
戻り値:
The audio data loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadModel

Spatial loadModel(ModelKey key)
Loads a named model. Models can be jME3 object files (J3O) or OgreXML/OBJ files.

パラメータ:
key -
戻り値:
The model that was loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadModel

Spatial loadModel(java.lang.String name)
Loads a named model. Models can be jME3 object files (J3O) or OgreXML/OBJ files.

パラメータ:
name -
戻り値:
The model that was loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadMaterial

Material loadMaterial(java.lang.String name)
Load a material (J3M) file.

パラメータ:
name -
戻り値:
The material that was loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadShader

Shader loadShader(ShaderKey key)
Loads shader file(s), shouldn't be used by end-user in most cases.

関連項目:
loadAsset(com.jme3.asset.AssetKey)

loadFont

BitmapFont loadFont(java.lang.String name)
Load a font file. Font files are in AngelCode text format, and are with the extension "fnt".

パラメータ:
name -
戻り値:
The font loaded
関連項目:
loadAsset(com.jme3.asset.AssetKey)