| Crates.io | bevy_dirs |
| lib.rs | bevy_dirs |
| version | 0.2.0 |
| created_at | 2025-11-24 03:42:39.720738+00 |
| updated_at | 2025-11-25 00:20:55.137215+00 |
| description | Use the platform-specific data directories as asset sources in bevy. |
| homepage | |
| repository | https://codeberg.org/ThePoultryMan/bevy_dirs |
| max_upload_size | |
| id | 1947334 |
| size | 85,154 |
Use the platform-specific data directories as asset sources in bevy.
bevy_dirs provides an asset source for each directory provided by
directories, a list of which is
available here.
Each directory corresponds to an asset source of the same name.
For example, to read from your project's config dir (~/.config/project/), you would use:
assets.load("config://my-config.json");
However, there is a notable exception, that being that all base directories
begin with the prefix base_. This avoids confusing them with the project
directories of the same name.
For example, to load from the base config dir (~/.config/), you would use:
assets.load("base_config://my-config.json");
bevy_dirs comes with a feature for each directory provided by directories.
If this feature is enabled, it allows you to use the respective directory as an
asset source.
For convenience, all of these features are enabled by default. However, it is
recommended that you disable default features, and only activate the ones that
you need. For example, to only enable the base config directory and the project
data directory you would use the following in your Cargo.toml:
[dependencies]
bevy_dirs = { version = "*", default-features = false, features = ["base_config", "data"] }
# or the following
[dependencies.bevy_dirs]
version = "*"
default-features = false
features = [
"base_config",
"data",
]
| bevy_dirs | bevy |
|---|---|
| 0.1.0 | ^0.17 |