bevy-kenney-assets

Crates.iobevy-kenney-assets
lib.rsbevy-kenney-assets
version0.1.0
sourcesrc
created_at2024-08-16 06:19:44.543976
updated_at2024-08-16 06:19:44.543976
descriptionUse kenney spritesheets as texture atlases in Bevy
homepage
repositoryhttps://github.com/rust-adventure/bevy-kenney-assets
max_upload_size
id1339955
size123,524
Chris Biscardi (ChristopherBiscardi)

documentation

README

bevy-kenney-assets

Load kenney assets as texture atlases

  1. Acquire kenney assets

    • make sure the spritesheet .xml and associated .png have the same name
    • place assets in assets/ directory
  2. Add bevy-kenney-assets

    cargo add bevy-kenney-assets
    
  3. Add Plugin

    app.add_plugins(KenneyAssetPlugin);
    
  4. Load spritesheets

    a. with AssetServer

     ```rust
     let handle: Handle<KenneySpriteSheetAsset> = asset_server.load("spaceShooter2_spritesheet_2X.xml");
     ```
    

    b. with bevy_asset_loader

    ```rust
    #[derive(AssetCollection, Resource)]
    pub struct ImageAssets {
        #[asset(path = "space-shooter-redux/sheet.xml")]
        pub space_sheet: Handle<KenneySpriteSheetAsset>,
    }
    ```
    
Commit count: 0

cargo fmt