Crates.io | bevy_web_asset |
lib.rs | bevy_web_asset |
version | |
source | src |
created_at | 2021-09-18 08:24:39.101775+00 |
updated_at | 2025-02-01 17:52:07.679652+00 |
description | Implementations for http(s) asset sources for Bevy |
homepage | |
repository | https://github.com/johanhelsing/bevy_web_asset |
max_upload_size | |
id | 453244 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This is a tiny crate that that adds the ability to load assets from http and https urls.
Supports both wasm (web-sys) and native.
This is nice if you want to keep your content on a server, even when developing native games. Use cases can be:
NOTE: You need to add the plugin before AssetPlugin
:
use bevy::prelude::*;
use bevy_web_asset::WebAssetPlugin;
fn main() {
App::new()
// The `WebAssetPlugin` must be inserted before the `AssetPlugin`
.add_plugins((
WebAssetPlugin::default(),
DefaultPlugins
))
// ...
.run();
}
But using it is quite simple, just use http urls instead of regular asset paths.
let font: Handle<Font> = asset_server.load("https://example.com/fonts/quicksand-light.ttf");
Or:
commands.spawn(SpriteBundle {
// Simply use a url where you would normally use an asset folder relative path
texture: asset_server.load("https://johanhelsing.studio/assets/favicon.png"),
..default()
});
I intend to support the latest bevy release in the main
branch.
bevy | bevy_web_asset |
---|---|
0.15 | 0.10, main |
0.14 | 0.9, |
0.13 | 0.8 |
0.12 | 0.7 |
0.9 | 0.5 |
0.8 | 0.4 |
0.7 | 0.3 |
0.6 | 0.2 |
0.5 | 0.1 |
bevy_web_asset
is dual-licensed under either
at your option.
PRs welcome!