A drop-in entity editor for EnTT with Dear ImGui

Overview

imgui_entt_entity_editor

A drop-in, single-file entity editor for EnTT, with ImGui as graphical backend.

demo-code (live)

Editor screenshot0

Editor with Entiy-List screenshot1

With Drag and Drop vid

example usage

struct Transform {
    float x = 0.f;
    float y = 0.f;
};

struct Velocity {
    float x = 0.f;
    float y = 0.f;
};

namespace MM {
template <>
void ComponentEditorWidget<Transform>(entt::registry& reg, entt::registry::entity_type e)
{
	auto& t = reg.get<Transform>(e);
	ImGui::DragFloat("x", &t.x, 0.1f);
	ImGui::DragFloat("y", &t.y, 0.1f);
}

template <>
void ComponentEditorWidget<Velocity>(entt::registry& reg, entt::registry::entity_type e)
{
	auto& v = reg.get<Velocity>(e);
	ImGui::DragFloat("x", &v.x, 0.1f);
	ImGui::DragFloat("y", &v.y, 0.1f);
}
}


entt::registry reg;
MM::EntityEditor<entt::entity> editor;

editor.registerComponent<Transform>("Transform");
editor.registerComponent<Velocity>("Velocity");

Dependencies

The editor uses EnTTv3.9.0 and ImGui. (tested with ImGui 1.68, 1.72b, 1.75, 1.78, 1.82, 1.85) To use it with EnTTv3.0.0, use the dedicated branch. For specific EnTT version check the tags, if a new EnTT version does not require a update, I won't make a new Release. Releases available for EnTT 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.2.2, 3.3.x, 3.4.0, 3.6.0-3.8.1, 3.9.0.

You might also like...
Amiga 1200 keyboard MPU drop-in replacement pcb
Amiga 1200 keyboard MPU drop-in replacement pcb

A1200_keyb_MPU Amiga 1200 keyboard MPU drop-in replacement pcb As the 68HC05 (p/n 391508-01) used in the Amiga 1200 is getting to be very expensive, I

mold is a faster drop-in replacement for existing Unix linkers
mold is a faster drop-in replacement for existing Unix linkers

mold: A Modern Linker mold is a faster drop-in replacement for existing Unix linkers. It is several times faster than LLVM lld linker, the second-fast

D2R mod generator. Provide quick tool to generate .txt files to change game balance: increase drop, monster density or even randomize items.
D2R mod generator. Provide quick tool to generate .txt files to change game balance: increase drop, monster density or even randomize items.

Diablo 2 mod generator Generator is inspired by d2modmaker. It provides fast and easy way to create mod without any modding knowledge. Features includ

Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

EnTT is a header-only, tiny and easy to use library for game programming and much more written in modern C++. Among others, it's used in Minecraft by

apecs: A Petite Entity Component System

apecs: A Petite Entity Component System A header-only, very small entity component system with no external dependencies.

EntityX - A fast, type-safe C++ Entity-Component system

EntityX - A fast, type-safe C++ Entity Component System NOTE: The current stable release 1.0.0 breaks backward compatibility with 1.0.0. See the cha

[WIP] Experimental C++14 multithreaded compile-time entity-component-system library.

ecst Experimental & work-in-progress C++14 multithreaded compile-time Entity-Component-System header-only library. Overview Successful development of

C++ single-header entity component system library

ECS This is a simple C++ header-only type-safe entity component system library. It makes heavy use of C++11 constructs, so make sure you have an up to

C++ entity-component system

CORGI Version 1.0.2 {#corgi_readme} CORGI is a C++ entity-component system library developed primarily for games that focus on simplicity and flexibil

Comments
  • Question about entt::component

    Question about entt::component

    I don't seem to be able to compile my project with recent entt versions and your library. Surprisingly, the demo code works perfectly. This is more of a question than an issue. Where is the entt::component type that your code uses internally? I cannot find it in entt's source.

    Edit: Okay, so it seems to be present on the latest release version but not included in the current master branch. So, entt has decided to not include the entt::component in newer versions I assume.

    opened by GnikDroy 12
  • Support entt 3.3.0. Contains incompatible changes and a modified API.

    Support entt 3.3.0. Contains incompatible changes and a modified API.

    I didn't find a dev branch so hopefully we can work on this pull request before merging to master. I have written the demo code as well. I will send a PR on that repository as well.

    Please feel free to rename the class/function names since I had it customized for my use.

    opened by GnikDroy 3
Releases(entt_v3.11.0)
Owner
Erik Scholz
Hit me up on [matrix] `@green:g-s.xyz` Currently accepting Job offers.
Erik Scholz
Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.

Dear ImGui (This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addit

Flix 351 Nov 24, 2022
A small, dependency-free node editor extension for dear imgui.

imnodes A small, dependency-free node editor extension for dear imgui. Features: Create nodes, links, and pins in an immediate-mode style Single heade

Johann Muszynski 1.3k Nov 27, 2022
Simple text editor in C++ - Simple editor built upon kilo editor.

GUMBO editor Simple editor built upon kilo editor. Still big work in progress although this is just fun side project to learn more C/C++. From 0.0.2->

Filip IvanuĊĦec 3 Sep 15, 2021
Meta - static reflection tools for c++. i mostly use this with entt.

meta Static reflection tools for C++. I use it with EnTT but it can work with anything. The main features the library provides are: Registering types

Nikhilesh S 9 Jul 12, 2022
An experimental sprite rendering setup utilizing SSBO's, Threading, EnTT reactive systems, and array-textures based sprite caching.

entt-reactive An experimental sprite rendering setup utilizing pooled SSBO's, a multithreaded setup based on Even Todd's The Poor Man's Threading Arch

Jackie Fuchs 7 Apr 29, 2022
An improved plot widget for Dear ImGui, aimed at displaying audio data

imgui-plot An improved plot widget for Dear ImGui, aimed at displaying audio data TOC Screenshots Rationale Usage Installation FAQ Screenshots Display

Anton Lobashev 396 Nov 19, 2022
api & source menu base import imgui from imgui-js

onetap v4 crack https://discord.gg/AXCtxVH4PB people asking me for otv4 source "bin2h" (meaning binary to hex) large hexadecimal array deleted all the

h4xr0x#1337 9 Sep 6, 2022
A simple "no frills" drop-in replacement PCB for the KBDfans 67mkII / 67lite

67mk_E A simple "no frills" drop-in replacement PCB for the KBDfans 67mkII / 67lite KiCAD PCB files Gerbers for PCB production JLCPCB BOM JLCPCB CPL V

null 23 Nov 2, 2022
Windows 11 Drag & Drop to the Taskbar (Partial Fix)

Windows 11 Drag & Drop to the Taskbar (Partial Fix) This program partially fixes the missing "Drag & Drop to the Taskbar" support in Windows 11. In th

null 1.3k Nov 27, 2022
Windows 11 Drag & Drop to the Taskbar (Fix)

Windows 11 Drag & Drop to the Taskbar (Fix) This program fixes the missing "Drag & Drop to the Taskbar" support in Windows 11. In the best case, such

null 1.3k Nov 26, 2022