bevy/release-content/release-notes/http_source.md
2025-06-30 19:09:55 +01:00

20 lines
890 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: HTTP Assets
authors: ["@johanhelsing", "@mrchantey", "@jf908"]
pull_requests: [17889]
---
Bevy now supports downloading assets over http and https.
Use the new `http` and `https` features to enable `http://` and `https://` URLs as asset paths.
This functionality is powered by the [`ureq`](https://github.com/algesten/ureq) crate on native platforms and the fetch API on wasm.
```rust
let image = asset_server.load("https://example.com/image.png");
commands.spawn(Sprite::from_image(image));
```
By default these assets arent saved anywhere but you can enable the `http_source` feature to cache assets on your file system.
The implementation has changed quite a bit but this feature originally started out as an upstreaming of the [`bevy_web_asset`](https://github.com/johanhelsing/bevy_web_asset) crate.
Special thanks to @johanhelsing and bevy_web_asset's contributors!