Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
ObjectsWidget.hpp
Go to the documentation of this file.
1
7#pragma once
8
9#include <memory>
10#include <vector>
11
12#include <ECS/Registry.hpp>
13#include <UI/Widget.hpp>
14
15namespace shkyera {
16
22class ObjectsWidget : public Widget {
23 public:
24 using Widget::Widget;
25
26 ObjectsWidget(std::string name);
27
33 void setRegistry(std::shared_ptr<Registry> registry);
34
38 virtual void draw() override;
39
40 private:
44 void drawCreate();
45
50
51 std::shared_ptr<Registry> _registry;
52 std::vector<std::function<void(Entity)>> _onNewEntityCallbacks;
54};
55
56} // namespace shkyera
Definition EntityHierarchy.hpp:20
A user interface widget for managing game objects.
Definition ObjectsWidget.hpp:22
Entity _draggedEntity
Definition ObjectsWidget.hpp:53
std::vector< std::function< void(Entity)> > _onNewEntityCallbacks
Definition ObjectsWidget.hpp:52
virtual void draw() override
Implementation of the abstract draw method to render the game objects widget.
Definition ObjectsWidget.cpp:21
void setRegistry(std::shared_ptr< Registry > registry)
Set the game to associate with this widget.
Definition ObjectsWidget.cpp:17
void drawObjectHierarchy(Entity parent, const EntityHierarchy &hierarchy, size_t depth)
Draw the list of game objects and allow selection.
Definition ObjectsWidget.cpp:54
std::shared_ptr< Registry > _registry
Definition ObjectsWidget.hpp:51
void drawCreate()
Draw the creation panel for new game objects.
Definition ObjectsWidget.cpp:34
An abstract base class representing a GUI widget.
Definition Widget.hpp:23
Widget(std::string name)
Constructor to create a widget with a specified name.
Definition Widget.cpp:5
Definition Asset.hpp:6
uint32_t Entity
Definition Entity.hpp:7
Definition Clock.hpp:9