AssetsLoader
Creates and loads assets using PIXI.Assets by creating a bundle from the assets
prop.
It contains two slots, loading
and the default. The default slot will not
render until the loading has completed. You can show progress by using the progress
prop from the loading
slot.
Usage
Assets init options
You may call PIXI.Assets.init()
to configure
the behaviour of the Assets loader, but you must do it before the first time you render an AssetsLoader
component.
Note that PIXI.Assets
can only be initialized once.
API
Props
Name | Description |
---|---|
assets [] | Array<string PIXI.UnresolvedAssetObject> An array of assets to load. These will get loaded as a bundle. |
bundleName | string The name of the bundle for the assets. By default a name is generated for you. |
progress 0 | number |
unload false | boolean Unload the bundle when the component is unmounted, freeing the assets from memory. Default is false |
Slots
Name | Props | Fallback |
---|---|---|
default | {} | |
loading | { progress: number } |
Events
Name | Type | Detail |
---|---|---|
complete | dispatched | null |
progress | dispatched | |
start | dispatched | null |