This tool enables you to specify game world dimensions, upload a background image, place stations on a canvas, create connection lines between stations, and export the data to CSV for integration into your game.
- World Setup: Configure game world dimensions (width and height)
- Background Image: Upload and display a background image for reference
- Station Placement: Click on the canvas to add stations with properties (ID, name, zone)
- Draggable Stations: Easily adjust station positions by dragging
- Line Creation: Create metro lines with custom colors
- Station Connections: Connect stations to form metro lines
- Interchange Detection: Automatically mark stations that belong to multiple lines
- Data Export: Export all data to CSV format for use in Phaser games
- Node.js 18.0 or higher
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/metromapeditor.git cd metromapeditor
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
- Use the sliders in the World Settings panel to set the width and height of your game world
- Click "Apply Dimensions" to update the canvas
- Optionally upload a background image for reference
- Click anywhere on the canvas to add a new station
- Fill in the station details (ID, name, zone)
- The station will appear on the canvas and in the Stations list
- Click "Add Line" in the Lines panel
- Fill in the line details (ID, name, color)
- Select the line from the list to make it active
- Click on stations to add them to the line
- Select multiple stations by holding Ctrl/Cmd while clicking on them
- With a line active, the selected stations will be connected in the order they were selected
- Once you've created your metro map, click "Export to CSV" in the Export panel
- The CSV file will be downloaded, ready to be used in your Phaser game
- Ctrl/Cmd + Click: Select multiple stations
- Click and Drag: Move the canvas view
- Mouse Wheel: Zoom in/out
- Built with Next.js, React, and Konva
- UI components from shadcn/ui
- CSV export using PapaParse