Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::ObjectsWidget Class Reference

A user interface widget for managing game objects. More...

#include <ObjectsWidget.hpp>

Inheritance diagram for shkyera::ObjectsWidget:
[legend]

Public Member Functions

 ObjectsWidget (std::string name)
 
void setRegistry (std::shared_ptr< Registry > registry)
 Set the game to associate with this widget.
 
virtual void draw () override
 Implementation of the abstract draw method to render the game objects widget.
 
 Widget (std::string name)
 Constructor to create a widget with a specified name.
 
- Public Member Functions inherited from shkyera::Widget
 Widget (std::string name)
 Constructor to create a widget with a specified name.
 
virtual ~Widget ()=default
 Default virtual destructor.
 

Private Member Functions

void drawCreate ()
 Draw the creation panel for new game objects.
 
void drawObjectHierarchy (Entity parent, const EntityHierarchy &hierarchy, size_t depth)
 Draw the list of game objects and allow selection.
 

Private Attributes

std::shared_ptr< Registry_registry
 
std::vector< std::function< void(Entity)> > _onNewEntityCallbacks
 
Entity _draggedEntity
 

Additional Inherited Members

- Public Attributes inherited from shkyera::Widget
std::string _name
 The name of the widget.
 

Detailed Description

A user interface widget for managing game objects.

The ObjectsWidget class provides a graphical user interface for creating, listing, and selecting game objects.

Constructor & Destructor Documentation

◆ ObjectsWidget()

shkyera::ObjectsWidget::ObjectsWidget ( std::string  name)

Member Function Documentation

◆ draw()

void shkyera::ObjectsWidget::draw ( )
overridevirtual

Implementation of the abstract draw method to render the game objects widget.

Implements shkyera::Widget.

◆ drawCreate()

void shkyera::ObjectsWidget::drawCreate ( )
private

Draw the creation panel for new game objects.

◆ drawObjectHierarchy()

void shkyera::ObjectsWidget::drawObjectHierarchy ( Entity  parent,
const EntityHierarchy hierarchy,
size_t  depth 
)
private

Draw the list of game objects and allow selection.

◆ setRegistry()

void shkyera::ObjectsWidget::setRegistry ( std::shared_ptr< Registry registry)

Set the game to associate with this widget.

Parameters
registryA shared pointer to the registry to associate with this widget.

◆ Widget()

shkyera::Widget::Widget ( std::string  name)

Constructor to create a widget with a specified name.

Parameters
nameThe name of the widget.

Member Data Documentation

◆ _draggedEntity

Entity shkyera::ObjectsWidget::_draggedEntity
private

◆ _onNewEntityCallbacks

std::vector<std::function<void(Entity)> > shkyera::ObjectsWidget::_onNewEntityCallbacks
private

◆ _registry

std::shared_ptr<Registry> shkyera::ObjectsWidget::_registry
private

The documentation for this class was generated from the following files: