-
Notifications
You must be signed in to change notification settings - Fork 6
Preloading assets
Make sure you've read Working with assets.
System.loadAssetPack
returns a Promise. Its progressChanged
signal can be listened on to show a
progress bar:
var loader = System.loadAssetPack(Manifest.fromAssets("bootstrap"));
loader.progressChanged.connect(function () {
trace("Download progress: " + (loader.progress/loader.total));
});
loader.get(function (pack) {
// Download complete, use the pack to start the game
});
Take a look at Space Date's preloader for an example of a simple progress bar. Many games will want to show images and sound in their preloader. In this case, create two asset packs, "bootstrap" and "main". "bootstrap" is loaded first and contains only the assets required to display the preloader, while "main" contains all the rest of the game's assets.
To learn all about asset packs, read Working with assets
Documentation guide for Flambe - Targeted to version 4.0+
Flambe | Installation | Demo projects | Showcase | API Reference | Forum
Flambe is MIT licensed and available for free. Feel free to contribute!
- Home / Installation
- Entity / Components
- Core
- Assets
- Publish your game
- Other
- Editors
- Plugins, tools, extensions
- Help
- More Flambe