{"id":15282703,"url":"https://github.com/danielfeather/bevy_mod_spritesheet","last_synced_at":"2026-01-30T00:36:03.110Z","repository":{"id":230743717,"uuid":"779373057","full_name":"danielfeather/bevy_mod_spritesheet","owner":"danielfeather","description":"Create Bevy TextureAtlases from common spritesheet formats","archived":false,"fork":false,"pushed_at":"2024-08-12T11:38:07.000Z","size":120,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-01T14:36:22.178Z","etag":null,"topics":["bevy","spritesheets","texture-atlas"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielfeather.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-29T17:27:49.000Z","updated_at":"2024-08-09T11:57:41.000Z","dependencies_parsed_at":"2024-08-09T13:04:51.988Z","dependency_job_id":null,"html_url":"https://github.com/danielfeather/bevy_mod_spritesheet","commit_stats":null,"previous_names":["danielfeather/bevy_mod_spritesheet"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfeather%2Fbevy_mod_spritesheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfeather%2Fbevy_mod_spritesheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfeather%2Fbevy_mod_spritesheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfeather%2Fbevy_mod_spritesheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielfeather","download_url":"https://codeload.github.com/danielfeather/bevy_mod_spritesheet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219847247,"owners_count":16556405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","spritesheets","texture-atlas"],"created_at":"2024-09-30T14:36:23.218Z","updated_at":"2026-01-30T00:36:03.057Z","avatar_url":"https://github.com/danielfeather.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Sprite Sheet Formats for Bevy\n\n![Build and Test Workflow](https://github.com/danielfeather/bevy_mod_spritesheet/actions/workflows/build-and-test.yml/badge.svg?event=push)\n[![crates.io](https://img.shields.io/crates/v/bevy_mod_spritesheet)](https://crates.io/crates/bevy_mod_spritesheet)\n[![docs.rs](https://docs.rs/bevy_mod_spritesheet/badge.svg)](https://docs.rs/bevy_mod_spritesheet)\n\nCreate [Bevy](https://github.com/bevyengine/bevy) `TextureAtlasLayout`s from sprite sheet formats\n\n\u003e ⚠️ This is still a work in progress, expect breaking changes on every minor release ⚠️\n\n\u003c/div\u003e\n\n## Overview\n\nTo use sprite sheets within Bevy you have to create a `TextureAtlasLayout`, if the sprites are in grid form and are of equal size, then this is fairly straightforward to set up (see [example](https://github.com/bevyengine/bevy/blob/release-0.13.2/examples/2d/sprite_sheet.rs)), but sprite sheets come in different shapes and sizes and often times they a bit more complex.\n\nWhile you can set up the texture atlas yourself, most likely you'll have all of the sprites and their positions defined in an accompanying metadata file.\n\nAt its core, this crate allows you to use the metadata file to build a `TextureAtlasLayout` for you.\n\n## Highlights\n\n- Supported formats: \n    - JSON Array\n    - JSON Hash\n- Choose a sprite by using the `Frame` component with the name of frame you want from the sprite sheet on an entity`\n- Automatic loading of textures, if supported by the sprite sheet format.\n\n## Getting Started\n\n1. Add the `SpriteSheetPlugin` to your app.\n```rs\nuse bevy_mod_spritesheet::SpriteSheetPlugin;\n...\napp.add_plugins(SpriteSheetPlugin)\n...\n```\n\n2. Using `Res\u003cAssetServer\u003e`, `load` the sprite sheet file and corresponding texture and insert the handles onto an entity, along with the `Frame` component and a Bevy `SpriteBundle`.\n\n\n\u003e ⚠️ By default, automatic texture loading is turned off. If you want to enable this. Add the `SpriteSheetOptions` component and set `texture_loading` to `true`\n\n```rs\nuse bevy_mod_spritesheet::{format::json::array::JsonArray, Frame, SpriteSheet, SpriteSheetBundle, SpriteSheetOptions, SpriteSheetPlugin};\n\nlet sprite_sheet: Handle\u003cSpriteSheet\u003cJsonArray\u003e\u003e = asset_server.load(\"gabe-idle-run.json\");\nlet image: Handle\u003cImage\u003e = asset_server.load(\"gabe-idle-run.png\");\n\ncommands.spawn((\n    SpriteBundle {\n        texture: image,\n        sprite: Sprite {\n            custom_size: Some(Vec2::splat(500.0)),\n            ..default()\n        },\n        ..default()\n    },\n    Frame::name(\"gabe-idle-run 6.png\".into()),\n    sprite_sheet, \n));\n\n/// Using `bevy_mod_spritesheet::SpriteSheetBundle`\ncommands.spawn((\n    SpriteBundle {\n        sprite: Sprite {\n            custom_size: Some(Vec2::splat(500.0)),\n            ..default()\n        },\n        ..default()\n    },\n    SpriteSheetBundle {\n        frame: Frame::name(\"gabe-idle-run 6.png\".into()),\n        options: SpriteSheetOptions {\n            texture_loading: true,\n        },\n        sprite_sheet,\n    },\n));\n\n```\n3. The `Handle\u003cTextureAtlasLayout\u003e` and `TextureAtlas` will be created in the background and inserted on the entity. If the sprite doesn't render correctly, check the console for error messages.\n\n## Example\n\nCheck out the `examples` folder for ideas on usage.\n\n## Supported Bevy Versions\n\n|`bevy`|`bevy_mod_spritesheet`|\n|---|---|\n|0.14|0.3, main|\n|0.13|0.2|\n|0.13|0.1|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfeather%2Fbevy_mod_spritesheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielfeather%2Fbevy_mod_spritesheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfeather%2Fbevy_mod_spritesheet/lists"}