Crates.io | leafwing_manifest |
lib.rs | leafwing_manifest |
version | |
source | src |
created_at | 2024-04-17 22:18:02.289731 |
updated_at | 2024-12-06 01:31:29.993247 |
description | A flexible crate for managing game assets that share a common structure. Manifests are generated from on-disk data, and offer a straightforward way to quickly look-up and generate game objects. |
homepage | https://leafwing-studios.com/ |
repository | https://github.com/leafwing-studios/leafwing_manifest |
max_upload_size | |
id | 1211838 |
Cargo.toml error: | TOML parse error at line 23, column 1 | 23 | 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 |
leafwing_manifest
is a straightforward, opinionated tool to transform "assets on disk" into flexible, robust objects inside of your Bevy game.
There are four key concepts:
Resource
which contains a mapping from identitifiers to items.Data is deserialized from disk into a raw manifest, which is processed into a manifest which contains a list of all available game objects of a given class. That manifest is then used to spawn and look up the properties of specific kinds of game objects in your game code.
bevy Version |
leafwing_manifest Version |
---|---|
0.13 | 0.1 |
0.14 | 0.2 |
An in-memory resource where you can look up the statistics for various game objects is incredibly useful:
For more background reading on why this crate exists, and the design decisions made, check out MOTIVATION.md
.
To get started:
AssetState
(like the SimpleAssetState
that we ship) to your app that handles the lifecycle of loading assets.ManifestPlugin<S: AssetState>
to your App
.Monster
) that stores the final data that you want to share between all objects of the same kind.app.register_manifest::<Monster>
, supplying the path to the data to load.Manifest<Monster>.get(id: Id<Monster>)
.See the simple.rs
example to jump right in!
If your assets require processing (for validation, or if they contain references to other assets),
you will need a raw manifest type, and corresponding raw item type.
Take a look at the raw_manifest.rs
example next!
Note that we don't compress our manifests into a binary format in our examples. While you can do so, we don't encourage you to (except as an optimization in shipped games). The added pain during version control and debugging is typically not worth the improvements to file size or loading speed during development.