Creates a new AssetLibraryBundle
object.
Defines which asset should have precedence when resolving a naming conflict between
two assets of which one has just been renamed by the user or by a parser. By default
ConflictPrecedence.FAVOR_NEW
is used, meaning that the newly renamed
asset will keep it's new name while the older asset gets renamed to not conflict.
This property is ignored for conflict strategies that do not actually rename an asset automatically, such as ConflictStrategy.IGNORE and ConflictStrategy.THROW_ERROR.
Defines which asset should have precedence when resolving a naming conflict between
two assets of which one has just been renamed by the user or by a parser. By default
ConflictPrecedence.FAVOR_NEW
is used, meaning that the newly renamed
asset will keep it's new name while the older asset gets renamed to not conflict.
This property is ignored for conflict strategies that do not actually rename an asset automatically, such as ConflictStrategy.IGNORE and ConflictStrategy.THROW_ERROR.
Defines which strategy should be used for resolving naming conflicts, when two library
assets are given the same name. By default, ConflictStrategy.APPEND_NUM_SUFFIX
is used which means that a numeric suffix is appended to one of the assets. The
conflictPrecedence
property defines which of the two conflicting assets will
be renamed.
Defines which strategy should be used for resolving naming conflicts, when two library
assets are given the same name. By default, ConflictStrategy.APPEND_NUM_SUFFIX
is used which means that a numeric suffix is appended to one of the assets. The
conflictPrecedence
property defines which of the two conflicting assets will
be renamed.
Adds an asset to the asset library, first making sure that it's name is unique
using the method defined by the conflictStrategy
and
conflictPrecedence
properties.
Add an event listener
Create an AssetLibraryIterator instance that can be used to iterate over the assets in this asset library instance. The iterator can filter assets on asset type and/or namespace. A "null" filter value means no filter of that type is used.
Asset type to filter on (from the AssetType enum class.) Use null to not filter on asset type.
Namespace to filter on. Use null to not filter on namespace.
Callback function to use when deciding whether an asset should be included in the iteration or not. This needs to be a function that takes a single parameter of type IAsset and returns a boolean where true means it should be included.
Dispatch an event
check if an object has an event listener assigned to it
Loads a file and (optionally) all of its dependencies.
The URLRequest object containing the URL of the file to be loaded.
An optional context object providing additional parameters for loading
An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets
An optional parser object for translating the loaded data into a usable resource. If not provided, Loader will attempt to auto-detect the file type.
A handle to the retrieved resource.
Loads a resource from existing data in memory.
The data object containing all resource information.
An optional context object providing additional parameters for loading
An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets
An optional parser object for translating the loaded data into a usable resource. If not provided, Loader will attempt to auto-detect the file type.
A handle to the retrieved resource.
Removes all assets from the asset library, optionally disposing them as they are removed.
Defines whether the assets should also be disposed.
Removes an asset from the library, and optionally disposes that asset by calling it's disposeAsset() method (which for most assets is implemented as a default version of that type's dispose() method.
The asset which should be removed from this library.
Defines whether the assets should also be disposed.
Removes an asset which is specified using name and namespace.
The name of the asset to be removed.
The namespace to which the desired asset belongs.
Defines whether the assets should also be disposed.
Remove an event listener
Removes all assets belonging to a particular namespace (null for default) from the asset library, and optionall disposes them by calling their disposeAsset() method.
The namespace from which all assets should be removed.
Defines whether the assets should also be disposed.
Returns an AssetLibraryBundle instance. If no key is given, returns the default bundle instance (which is similar to using the AssetLibraryBundle as a singleton.) To keep several separated library bundles, pass a string key to this method to define which bundle should be returned. This is referred to as using the AssetLibrary as a multiton.
Defines which multiton instance should be returned.
An instance of the asset library
Generated using TypeDoc
AssetLibraryBundle enforces a multiton pattern and is not intended to be instanced directly. Its purpose is to create a container for 3D data management, both before and after parsing. If you are interested in creating multiple library bundles, please use the
getInstance()
method.