bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add remote_asset_loader example

Open afonsolage opened this issue 2 years ago • 1 comments

Objective

  • Showcase how to use AssetReader and AssetWriter to download an asset from a CDN when it doesn't exists local.

Solution

  • Add an example (remote_asset_loader) which showcases how to download an asset from a CDN.
  • Add ehttp as a new dev-dependencies.

Additional Context

  • This is somewhat related to #11694 since I'm also using ehttp and the same features.
  • This example won't work on wasm or Android since I need AssetWriter.
  • I'm using a Google Font since its Open Font License and it is compatible with MIT and Apache 2.0 (AFAIK);
  • At the end of the example main, I use std::fs::remove_file to "manually" do some cleanup, to avoid adding things to asset folder whenever someone runs this example.

afonsolage avatar Feb 12 '24 19:02 afonsolage

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

github-actions[bot] avatar Feb 12 '24 19:02 github-actions[bot]