bevy_dirs

Crates.iobevy_dirs
lib.rsbevy_dirs
version0.2.0
created_at2025-11-24 03:42:39.720738+00
updated_at2025-11-25 00:20:55.137215+00
descriptionUse the platform-specific data directories as asset sources in bevy.
homepage
repositoryhttps://codeberg.org/ThePoultryMan/bevy_dirs
max_upload_size
id1947334
size85,154
(ThePoultryMan)

documentation

README

docs.rs

bevy_dirs

Use the platform-specific data directories as asset sources in bevy.

Available Dirs

bevy_dirs provides an asset source for each directory provided by directories, a list of which is available here.

Asset Sources

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");

Features

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 Compatibility

bevy_dirs bevy
0.1.0 ^0.17
Commit count: 0

cargo fmt