project-kyoku/src/application/widgets/editorwidget.cpp

56 lines
1.0 KiB
C++
Raw Normal View History

2021-10-05 14:48:28 -04:00
#include "editorwidget.h"
#include "core/editor.h"
2021-10-05 14:48:28 -04:00
EditorWidget::EditorWidget(const std::shared_ptr<Editor>& editor) :
_editor(editor)
{}
void EditorWidget::input(const sf::Event& event)
{
_editor->input(PlayerInput{0, event});
2021-10-05 14:48:28 -04:00
}
void EditorWidget::update(const sf::Time& dt)
{
_editor->update(dt);
2021-10-05 14:48:28 -04:00
}
void EditorWidget::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
// !!!!!!!!!!!!!!!!!
(void)target; (void)states;
_editor->draw();
2021-10-05 14:48:28 -04:00
}
void EditorWidget::move(const sf::Vector2f& delta)
{
(void)delta;
// delegate to children
2021-10-05 14:48:28 -04:00
}
bool EditorWidget::isUnderMouse(int mouse_x, int mouse_y) const
{
return _parent->isUnderMouse(mouse_x, mouse_y);
2021-10-05 14:48:28 -04:00
}
void EditorWidget::setRect(const sf::FloatRect& rect)
{
(void)rect;
// basically useless beacuse editor widget fills the entire screen
2021-10-05 14:48:28 -04:00
}
sf::FloatRect EditorWidget::rect() const
{
return {};
2021-10-05 14:48:28 -04:00
}
void EditorWidget::setPosition(const sf::Vector2f& position)
{
(void)position;
2021-10-05 14:48:28 -04:00
}
sf::Vector2f EditorWidget::position() const
{
return {};
2021-10-05 14:48:28 -04:00
}