bevy_libgdx_atlas

Crates.iobevy_libgdx_atlas
lib.rsbevy_libgdx_atlas
version
sourcesrc
created_at2024-09-07 04:19:29.068753
updated_at2024-12-12 11:57:16.064277
descriptionSupport loading `libgdx.atlas` files (used for sprite sheets and such) as Bevy assets.
homepage
repositoryhttps://github.com/rustunit/bevy_libgdx_atlas
max_upload_size
id1366919
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`
size0
(extrawurst)

documentation

README

bevy_libgdx_atlas

Following released Bevy versions crates.io docs.rs discord

Support loading libgdx.atlas files (used for sprite sheets and such) as Bevy assets.

Read the article with more context around sprite atlases in Bevy on the rustunit blog.

Usage

Pack your spritesheet using https://github.com/crashinvaders/gdx-texture-packer-gui

Texture packer example

Add the LibGdxAssetPlugin to your app:

use bevy::prelude::*;
use bevy_libgdx_atlas::*;

let app = App::new();
app.add_plugins(MinimalPlugins);
app.add_plugins(AssetPlugin::default());
app.add_plugins(LibGdxAssetPlugin);

Now when you load files with the .libgdx.atlas extension through the asset server, or even bevy_asset_loader, they will load as a LibGdxAtlasAsset which you can then use.

Animated spritesheet example

[!TIP] Run cargo run --example animation to see this example for yourself!

Contributing

See our CONTRIBUTING.md

Our Other Crates

Compatible Bevy Versions

bevy bevy_libgdx_atlas
0.14 0.2
0.13 0.1

License

bevy_libgdx_atlas is dual-licensed under either MIT or Apache 2.0, at your option.

Commit count: 22

cargo fmt