Crates.io | bevy_ase |
lib.rs | bevy_ase |
version | 0.6.0 |
source | src |
created_at | 2023-09-02 10:39:02.27107 |
updated_at | 2023-09-02 10:39:02.27107 |
description | Utilities for loading Aseprite files into a Bevy application |
homepage | |
repository | |
max_upload_size | |
id | 961631 |
size | 58,871 |
Utilities for loading Aseprite files into a Bevy application.
Provides an AssetLoader struct which directly reads .aseprite files without an intermediate import step. The loader adds Resources generated by the files' data. Systems can invoke the loader's methods to start loading files, or query the loading state.
This library creates several types of resources:
This library exposes AseLoaderDefaultPlugin with default settings. This plugin initializes all of the above resources as Asset types, adds Loader and AseAssetLoader resources, and adds an importer system function to process loaded ase data.
For a custom configuration, import the constituent parts and add them to AppBuilder directly. The Texture resource is required to be initialized. Other asset types are optional.
use bevy::prelude::*;
use bevy_ase::asset::AseAsset;
use bevy_ase::loader::{AseLoaderDefaultPlugin, Loader};
use std::path::Path;
// Initialize and run a bevy app with the default bevy_ase configuration.
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(AseLoaderDefaultPlugin)
.add_system(load_sprites.system());
}
// Get an aseprite asset and send it to the loader.
pub fn load_sprites(asset_server: Res<AssetServer>, mut loader: ResMut<Loader>) {
let h: Handle<AseAsset> = asset_server.load(Path::new("sprites/hello.aseprite"));
loader.add(h.clone());
}
See the documentation for lib.rs for more information.
Forked from https://github.com/alpine-alpaca/bevy_proto_aseprite.
cargo run --example animated --features="benimator"
Improve error handling.
Atlas creation fails if there are too many / too big sprites.
Hot reloading. This requires dynamic atlas reconstruction.