Giter VIP home page Giter VIP logo

tilemapeditor's Introduction

TilemapEditor

Jade Tilemap Editor

The Editor uses the ECS system from the course https://pikuma.com/courses/cpp-2d-game-engine-development. You can load and save data to [.map] files. When saving and loading, the editor uses a [.lua] file that loads the the location of the [.map] files and the tilesets that are used.

This application was created to quickly make tile maps for small games created with the Pikuma Game Engine. I re-made the tilemap editor that I created in my ZeldaClone https://github.com/dwjclark11/ZeldaClone_NES. I added more functionality and made the code more clean and concise as my abilities continue to grow.

Build


Requires CMake 3.26 and vcpkg

Get VCPKG:

git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.bat

Make sure the following environment variables are set:

VCPKG_ROOT=[path_to_vcpkg]
VCPKG_DEFAULT_TRIPLET=x64-windows

Install dependencies

./vcpkg install glm spdlog sdl2 sdl2-ttf sdl2-image lua sol2
  • Linux Also needs GTK-+3.0 for NFD build sudo apt-get install build-essential libgtk-3-dev

Clone the repository

git clone https://github.com/dwjclark11/TilemapEditor.git

cmake -S . -B build 
cd build 
cmake --build . --config Release 

cd bin 
./TilemapEditor

Read the Docs

Video

tilemap_editor.mp4

Loading a Map Project

New_Tilemap_Vid.mp4

Technologies

  • ImGui - for user interface
  • SDL2 - for rendering and window/inputs
  • Sol/Lua - for loading files
  • ECS - from Pikuma Game Engine

Dependencies

  • SDL2
  • SDL2_ttf
  • SDL2_image
  • ImGui
  • SPDLOG
  • Sol/Lua
  • NFD

Functionality

  • Load/Add multiple tilemaps
  • Undo/Redo functionality when adding/removing tiles and changing canvas size
  • Save/Load capabilities.
    • I have changed the way that I load/save files. It differs from the course; therefore, you may have to rewrite the save functionality.
    • The load function uses lua/sol and loads previously saved projects and their assets/tilemaps into the asset manager.
  • Selecting different tiles based on where you click on the displayed tileset
  • Panning and Zooming

Tilemap Editor Controls

Key Shortcuts and Functions

key Function
W Move Camara Up
S Move Camera Down
A Move Camera Left
D Move Camera Right
Space Move Camera to Default Position
Ctrl + Z Undo Command
Ctrl + Shift + Z Redo Command
Ctrl + S Save/Save As Project
Ctrl + O Open Project
Ctrl + N New Canvas/Project

Mouse Functions

Mouse Button Function
Left Button Add Tile
Middle Button Pan/Move the Camera
Right Button Remove Tile
Wheel Up Zoom In
Wheel down Zoom Out

Issues to Work On

  • Only works on 1920 1080 Resolution, does not take into affect other screen resolutions
  • Box Collider Offset not scaling properly with zoom fixed
  • There are probably more bugs that I am still finding

tilemapeditor's People

Contributors

dwjclark11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tilemapeditor's Issues

ERROR LNK1104 The file 'SDL2.lib' could not be opened.

Hi. Dustin Clark.

I'm trying to use the TilemapEditor you created, but I'm getting an error. Can you help me?
When I build the solution, it fails to build with the following error.


ERROR LNK1104 The file 'SDL2.lib' could not be opened.

Here's what I did

  1. copy to a Git clone
  2. ran GenerateSln directly.
  3. then I opened the solution file in VS2022 and built it.

// I attach my VS version
Microsoft Visual Studio Community 2022
version 17.6.2

Add Docking for ImGui

Currently windows are just floating around. Should add in docking and use ImGui::DockBuilder for consistency.

Not saving and loading all attributes

Currently we are not saving the following:

  • current mouseRect size
  • If snap tiles is enabled
  • Current Scale
  • TileSize
  • etc.
    We should probably be saving the user preferences as well.

Set Tile Properties Button -> Should be removed

Sometimes the Set Tile Properties button is not pressed or forgotten. If that happens the user has to go back and remove tiles etc. Then set the properties again.

A Solution could be to listen for any changes being done to the tile properties and automatically apply those changes instead of having to enable them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.