{"id":27300730,"url":"https://github.com/evroon/bevy-where-was-i","last_synced_at":"2025-08-27T13:04:32.631Z","repository":{"id":287261695,"uuid":"964154991","full_name":"evroon/bevy-where-was-i","owner":"evroon","description":"Saves and restores your camera position in Bevy","archived":false,"fork":false,"pushed_at":"2025-04-10T20:12:16.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T20:40:06.373Z","etag":null,"topics":["bevy","camera","deserialization","rust","rust-lang","save","savegame","serialization"],"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/evroon.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2025-04-10T19:16:40.000Z","updated_at":"2025-04-10T20:12:20.000Z","dependencies_parsed_at":"2025-04-10T20:40:09.233Z","dependency_job_id":"faf853c7-2f76-4181-913e-786629517d6b","html_url":"https://github.com/evroon/bevy-where-was-i","commit_stats":null,"previous_names":["evroon/bevy-where-was-i"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evroon%2Fbevy-where-was-i","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evroon%2Fbevy-where-was-i/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evroon%2Fbevy-where-was-i/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evroon%2Fbevy-where-was-i/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evroon","download_url":"https://codeload.github.com/evroon/bevy-where-was-i/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248502833,"owners_count":21114891,"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","camera","deserialization","rust","rust-lang","save","savegame","serialization"],"created_at":"2025-04-12T01:25:45.411Z","updated_at":"2025-08-27T13:04:32.614Z","avatar_url":"https://github.com/evroon.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    Bevy, where was I?\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://crates.io/crates/bevy_where_was_i\"\n    \u003e\u003cimg\n      src=\"https://img.shields.io/crates/v/bevy_where_was_i\"\n      alt=\"crate on crates.io\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/bevy_where_was_i\"\n    \u003e\u003cimg\n      src=\"https://img.shields.io/docsrs/bevy-where-was-i\"\n      alt=\"docs on docs.rs\"\n  /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/evroon/bevy-where-was-i/actions\"\n    \u003e\u003cimg\n      src=\"https://img.shields.io/github/actions/workflow/status/evroon/bevy-where-was-i/ci.yml\"\n      alt=\"build status\"\n  /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA tiny Bevy library that saves the camera position when the program closes, and restores it when\nyou launch the application again. This is useful when debugging and you don't want to continuously\nchange your hardcoded camera coordinates.\n\nNote that this actually works for any `Transform` component, and not only restores translation\ninformation, but also scale and rotation.\n\nThis crate is compatible with [bevy_panorbit_camera](https://github.com/Plonq/bevy_panorbit_camera).\n\n## Usage\n\nAdd the plugin:\n\n```rust ignore\n.add_plugins(WhereWasIPlugin::default())\n```\n\n### For a camera\n\nTo save the translation and rotation of a camera, add the `WhereWasI` component to an entity with a\n`Camera` component:\n\n```rust ignore\ncommands.spawn((\n    Camera::default(),\n    WhereWasI::camera(),\n));\n```\n\nNote: `WhereWasI::camera()` is equivalent to `WhereWasI::from_name(\"camera\")`.\n\n### For other entities\n\nFor other entities, a name has to be provided.\nAdd the `WhereWasI` component to an entity with a `Transform`:\n\n```rust ignore\ncommands.spawn((\n    PointLight::default(),\n    WhereWasI::from_name(\"point_light\"),\n));\n```\n\nSince `WhereWasI` indicates that `Transform` is a required component, we can omit it and\n`WhereWasI` will construct it. If you want to change the initial state of the `Transform` before a\nsavefile exists, add a `Transform` component to the bundle:\n\n```rust ignore\ncommands.spawn((\n    PointLight::default(),\n    Transform::from_xyz(5.0, 2.0, 5.0),\n    WhereWasI::from_name(\"point_light\"),\n));\n```\n\nSee the\n[3D scene example](https://github.com/evroon/bevy-where-was-i/blob/master/examples/3d_scene.rs)\nfor a complete example.\n\n### Save files\n\nThe save files will by default be stored in `./assets/saves`. You likely want to add this directory\nto you `.gitignore`. Alternatvely, you can configure a different directory when initializing\nthe plugin. For example, you can store the savefiles in the user's `.config` directory:\n\n```rust ignore\n.add_plugins(WhereWasIPlugin {\n    directory: \"~/.config/bevy-saves/my-game\".into(),\n})\n```\n\n`WhereWasIPlugin` will make sure the directory exists if it doesn't already.\n\n## Bevy version compatibility\n\n| bevy | bevy-where-was-i     |\n|------|----------------------|\n| 0.16 | 0.2.*                |\n| 0.15 | 0.1.*                |\n\n## License\n\nBracket is licensed under [MIT](https://choosealicense.com/licenses/mit/), see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevroon%2Fbevy-where-was-i","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevroon%2Fbevy-where-was-i","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevroon%2Fbevy-where-was-i/lists"}