-
Notifications
You must be signed in to change notification settings - Fork 6
Live asset reloading
Since Flambe 3, you can update assets, and see them change directly in the browser. This works in a debug build. This means when you update images, animations or other files, you don't need to recompile or even press refresh in your browser! 😝
You can simply listen to the changed-signal on the reloadCount of the Asset.
To test it, place a "my_file.txt" in your assetpack, build the project. Then watch the browser and your trace-console after you make changes in the file, while the project runs in your browser.
// pack refers to an AssetPack
var myFile:File = pack.getFile("my_file.txt");
trace("myFile content: " + myFile.toString());
// connect to reload count to detect asset reload
myFile.reloadCount.changed.connect(function(to:Int, from:Int)
{
trace("file reloaded. new content: " + myFile.toString());
});
Learn more about using Signals on Signal Event System
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