bevy_ecs_tiled 0.12.0

A Bevy plugin for loading Tiled maps
Documentation
use bevy::{input::common_conditions::input_toggle_active, prelude::*};

use bevy_inspector_egui::{
    bevy_egui::{EguiGlobalSettings, EguiPlugin},
    quick::WorldInspectorPlugin,
};

const TOGGLE_INSPECTOR_KEY: KeyCode = KeyCode::F1;

pub(super) fn plugin(app: &mut App) {
    // We want to render egui on the camera with 'PrimaryEguiContext' component
    app.insert_resource(EguiGlobalSettings {
        auto_create_primary_context: false,
        ..Default::default()
    });
    app.add_plugins((
        EguiPlugin::default(),
        WorldInspectorPlugin::default().run_if(input_toggle_active(false, TOGGLE_INSPECTOR_KEY)),
        avian2d::prelude::PhysicsDebugPlugin,
    ));

    app.add_systems(Startup, setup_help_text);
}

fn setup_help_text(mut commands: Commands) {
    commands
        .spawn(Node {
            display: Display::Flex,
            align_self: AlignSelf::FlexEnd,
            flex_direction: FlexDirection::Column,
            ..default()
        })
        .with_children(|builder| {
            builder.spawn(Text(String::from("Debug mode enabled")));
            builder.spawn(Text(String::from("Toggle inspector: [F1]")));
        });
}