Other

项目介绍

mDeram/2DMapEditor 是一个托管在 GitHub 上的开源项目,主要使用 Lua 编写,采用 Other 许可证,目前获得 16 个 Star、1 次 Fork。

仓库全名
mDeram/2DMapEditor
开源许可证
Other
Star 数
16
Fork 数
1
未关闭 Issue
1

README 摘要

2DMapEditor Single-layer 2D map editor using a .png tileset. It features map resizing, drawing, erasing, filling... Export maps to txt, json or lua format. Built with love2d it runs on Windows, macOS and Linux. Preview Tileset from https://ansimuz.itch.io/grotto-escape-game-art-pack Features Edition: Resize Draw Erase Fill Tile Picker Clear Movement: Move Zoom Display: Toggle grid Reset Import: .txt .json .lua…

完整内容见 GitHub 原始 README 或本页 。

常见问题

2DMapEditor 用什么语言开发?

主要使用 Lua 编写,采用 Other 许可证,目前有 16 个 Star。

2DMapEditor 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 2DMapEditor 的源码?

可以直接克隆仓库:git clone https://github.com/mDeram/2DMapEditor.git,默认分支为 main;安装与运行步骤见仓库 README。

2DMapEditor 最近还在维护吗?

仓库最近一次更新为 2024年7月10日,当前有 1 个未关闭 Issue;Star 数为 16,可作为社区活跃度的参考。

关于

Single-layer 2D map editor. From a tileset to a .txt .json or .lua file.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
20
价值分
10
活跃状态
活跃

语言占比

Lua
Shell

贡献者

README

2DMapEditor

Single-layer 2D map editor using a .png tileset.

It features map resizing, drawing, erasing, filling…

Export maps to txt, json or lua format.

Built with love2d it runs on Windows, macOS and Linux.

Preview

preview

Tileset from https://ansimuz.itch.io/grotto-escape-game-art-pack

Features

  • Edition:
    • Resize
    • Draw
    • Erase
    • Fill
    • Tile Picker
    • Clear
  • Movement:
    • Move
    • Zoom
  • Display:
    • Toggle grid
    • Reset
  • Import:
    • .txt
    • .json
    • .lua
  • Export:
    • .txt
    • .json
    • .lua
  • Set settings from editor.txt
  • Tiles display as drawing palette

Usage Instructions

This minimalist software does not provide any integrated tips or documentation, you should refer to this section if you need help.

Get started

  • Linux/MacOS install love2d v11.
  • Download the map editor.
  • Unzip it.
  • Add at least one tileset in the tileset/ directory.
  • Edit the “editor.txt” file next to the map editor and change some settings to fit your need.
  • Run the map editor (on Linux/MacOS either double click on the .love file or use $ love 2d_map_editor.love from the command prompt).
  • Create a map.
  • Export your map.
  • Your exported map should now appear in the map/ directory.

Shortcuts

Keys Description
D Draw
E Erase
F Fill
Alt Tile picker
Mouse Right Tile picker
←↑→↓ Move
Spacebar + Mouse Left Move
Mouse Wheel Zoom

Input/Output Format

A 2d map is encoded as a 2d array of numbers. Each number matches a tile from the tileset.

Considering the following tileset:

tileset to numbers

And this 2d array of number:

{
	{19, 19,  1,  4, 19},
	{21, 19,  9, 19, 19},
	{19, 19, 19, 19, 19},
	{16, 16,  6, 15, 16},
	{13, 13, 13, 13, 13}
}

We get the following map:

numbers_to_map

Importing a Map to Your Project

With Lua (5.1)

If your using the lua programming language, just require the map in your project:

local map = require("path/to/my/map")

Without Lua

Create/find a parser for the file format you want your map to be in.


Building

Builds are done using the “Release” script that itself uses boon. Running ./Release will create a folder named “release”, using ./Release -z will zip the folders contained in the release folder.


Project Status

The project is currently finished, however feel free to open an issue if you encounter one. No features will be added.

Why this Project & more…

Initialy I wanted to be able to create maps for my 2d games, I tried tiled but it’s a big editor with tons of features and it was exporting maps in the json format, so I should have learned how to use the editor and use a library to parse json files.

Since I only needed single layers maps I started this little project. It was one of my first desktop application so it was very interesting on many points.

I created the map editor 2+ years ago but I never finished some features/polish but used it in multiple projects like It Alive. It’s why I came back on it with the desire to make the initial idea come true. I find the project/code structure really bad now and that’s a good thing, it means that my programming practices/skills have improved since. If I had to do it again now, I would do it in a much different maner. Thanks for reading.

评论

暂无评论