|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
public interface AssetManager
AssetManager
provides an interface for managing the data assets
of a jME3 application.
メソッドの概要 | ||
---|---|---|
|
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 . |
メソッドの詳細 |
---|
void registerLoader(java.lang.String loaderClassName, java.lang.String... extensions)
loaderClassName
- extensions
- void registerLocator(java.lang.String rootPath, java.lang.String locatorClassName)
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.void registerLoader(java.lang.Class<? extends AssetLoader> loaderClass, java.lang.String... extensions)
loaderClass
- extensions
- void registerLocator(java.lang.String rootPath, java.lang.Class<? extends AssetLocator> locatorClass)
AssetManager
. AssetLocator
s 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)
void setAssetEventListener(AssetEventListener listener)
AssetEventListener
to receive events from this
AssetManager
. There can only be one AssetEventListener
associated with an AssetManager
listener
- AssetInfo locateAsset(AssetKey<?> key)
AssetKey
. This method
should be used for debugging or internal uses. 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.
AssetInfo
object returned from the AssetLocator
that located the asset, or null if the asset cannot be located.<T> T loadAsset(AssetKey<T> key)
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
java.lang.Object loadAsset(java.lang.String name)
loadAsset(new AssetKey(name)).
name
- The name of the asset to load.
loadAsset(com.jme3.asset.AssetKey)
Texture loadTexture(TextureKey key)
key
- The TextureKey
to use for loading.
loadAsset(com.jme3.asset.AssetKey)
Texture loadTexture(java.lang.String name)
name
- The name of the texture to load.
loadAsset(com.jme3.asset.AssetKey)
AudioData loadAudio(AudioKey key)
key
-
loadAsset(com.jme3.asset.AssetKey)
AudioData loadAudio(java.lang.String name)
name
-
loadAsset(com.jme3.asset.AssetKey)
Spatial loadModel(ModelKey key)
key
-
loadAsset(com.jme3.asset.AssetKey)
Spatial loadModel(java.lang.String name)
name
-
loadAsset(com.jme3.asset.AssetKey)
Material loadMaterial(java.lang.String name)
name
-
loadAsset(com.jme3.asset.AssetKey)
Shader loadShader(ShaderKey key)
loadAsset(com.jme3.asset.AssetKey)
BitmapFont loadFont(java.lang.String name)
name
-
loadAsset(com.jme3.asset.AssetKey)
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |