Crates.io | space_editor |
lib.rs | space_editor |
version | 0.3.1 |
source | src |
created_at | 2023-12-18 19:11:55.817558 |
updated_at | 2023-12-21 15:55:16.15737 |
description | Prefab editor for bevy game engine. Make levels/object templates with intuitive UI |
homepage | https://github.com/rewin123/space_editor |
repository | https://github.com/rewin123/space_editor |
max_upload_size | |
id | 1073581 |
size | 1,261,076 |
License: MIT
space_editor is useful tool for scene/prefab/prototyping with bevy engine. Its allow to create/modify levels/scenes/prefabs in fast gui based way.
Aspires to be editor for bevy while there is no official editor.
Getting Started To run the editor, use the following command:
cargo run
To run platformer example, use the following command:
cargo run run --example platformer --features bevy_xpbd_3d
The following explains how to integrate space_editor
as a game plugin to use the created prefabs in your game.
Add this line to your Cargo.toml file
space_editor = "0.3.0"
To utilize the prefab spawn system, simply add the plugin to your application as follows:
App::default()
.add_plugins(DefaultPlugins)
.add_plugins(PrefabPlugin)
For spawning, use the PrefabBundle:
commands.spawn(PrefabBundle::new("tile.scn.ron"))
.insert(Name::new("Prefab"));
(More code at examples/spawn_prefab.rs)
The editor is a ready to use executable that can be used and altered at your own necessity. It's base configuration is as follows, with simple_editor_setup
:
fn main() {
App::default()
.add_plugins(DefaultPlugins)
.add_plugins(SpaceEditorPlugin::default())
.add_systems(Startup, simple_editor_setup)
.run();
}
(Code from main.rs)
editor
feature.More detailed information in docs/README.md
Custom types can be added to the editor gui and prefab spawn system with just a single line:
use editor::prelude::EditorRegistryExt;
app.editor_registry::<Name>();
The representation of components in the editor UI can also be customized by bevy_inspector_egui library.
A prefab is simply a Bevy scene serialized to a readable and editable RON format. However, it needs to be spawned through PrefabBundle to activate custom logic such as adding global transforms to an object.
More documentation can be found at the docs folder
Any request for adding functionality to the editor is welcome. Open an issue on the issue tracker. Any pull request is welcome too:)
MIT - https://choosealicense.com/licenses/mit/
I'm using the editor to create my own Sci-Fi space game, so the name of the project starts with space_ :)