Loading...
Searching...
No Matches
CoreAdapter.h
Go to the documentation of this file.
1#ifndef UICOMPONENTADAPTER_H
2#define UICOMPONENTADAPTER_H
3
4#pragma once
5
6#include <Malena/Core/Core.h>
7
8namespace ml
9{
34 class CoreAdapter : public Core
35 {
36 protected:
46 virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
47
48 public:
54 virtual void update();
55
64 virtual void eventHandler(const std::optional<sf::Event>& event);
65
75 virtual sf::FloatRect getGlobalBounds() const override;
76
82 virtual void setPosition(const sf::Vector2f& position) override;
83
89 virtual sf::Vector2f getPosition() const override;
90 };
91
92} // namespace ml
93
94#endif // UICOMPONENTADAPTER_H
Concrete adapter that gives Core a default virtual interface.
Definition CoreAdapter.h:35
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draw this object to an SFML render target.
virtual void eventHandler(const std::optional< sf::Event > &event)
Handle an incoming SFML event.
virtual sf::Vector2f getPosition() const override
Return the current world-space position of this object.
virtual void setPosition(const sf::Vector2f &position) override
Set the world-space position of this object.
virtual void update()
Perform per-frame logic update.
virtual sf::FloatRect getGlobalBounds() const override
Return the axis-aligned bounding box of this object in world space.
Virtual base class for all Malena framework objects.
Definition Core.h:67
Definition Component.h:18
Rect< float > FloatRect
Vector2< float > Vector2f