A powerful 3D/2.5D game controller plugin for Bevy Engine.
The Map System provides a complete navigation solution including a Minimap, Full Map (World Map), and Compass. It handles marker tracking, 3D-to-2D projection, hierarchical positions (Buildings/Floors), and interactive elements like Quick Travel stations.
Global configuration for the map system.
#[derive(Resource)]
pub struct MapSettings {
pub show_minimap: bool,
pub show_full_map: bool,
pub minimap_zoom: f32, // Zoom level for minimap
pub full_map_zoom: f32, // Zoom level for full map
pub orientation: MapOrientation, // XY (Side), XZ (Top-down), YZ (Side)
}
The logic component that marks an entity as trackable.
#[derive(Component)]
pub struct MapMarker {
pub name: String,
pub icon_type: MapIconType, // Npc, Quest, Enemy, etc.
pub visible_in_minimap: bool,
pub visible_in_full_map: bool,
}
Detailed metadata for complex objects. Checks building/floor context to determine visibility usage.
building_index: ID of the building the object belongs to (-1 = Global).floor_index: ID of the floor.icon_type: Definition for the UI icon.A UI overlay (default: top-right) showing local entities.
MapOrientation.A fullscreen overlay toggled with the M key.
Rotates a UI element to match the player’s facing direction.
Transform rotation.Supports multi-level maps.
MapBuilding: Defines a building container.MapFloor: Defines a specific floor layer.building_index == A AND floor_index == 2 (or global markers) are clearly visible.Teleporters allowing instant movement.
QuickTravelStation: Component marking a teleport spot.Lore or information unlocked by map discovery.
MapGlossary: Unlocks content (title, content) when the associated marker is visited/interacted with.Special icons for quests/missions.
ObjectiveIcon: Auto-generates a MapMarker when added.To show an entity on the radar:
commands.spawn((
Transform::from_xyz(10.0, 0.0, 5.0),
MapMarker {
name: "Quest Giver".to_string(),
icon_type: MapIconType::Quest,
visible_in_minimap: true,
..default()
}
));
In your setup system:
fn configure_map(mut settings: ResMut<MapSettings>) {
settings.minimap_zoom = 1.5;
settings.orientation = MapOrientation::XZ; // Standard Top-Down
}
commands.spawn((
Transform::from_xyz(50.0, 0.0, 50.0),
QuickTravelStation {
destination: Vec3::new(0.0, 1.0, 0.0), // Base
is_active: true,
interact_message: "Travel to Base".into(),
},
// Add visual mesh...
));