Loading...
Searching...
No Matches
CoreAdapter.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith. All rights reserved.
2// Malena Framework — Proprietary Software. See LICENSE for terms.
3
4#ifndef MALENA_UICOMPONENTADAPTER_H
5#define MALENA_UICOMPONENTADAPTER_H
6
7#pragma once
8
10#include <Malena/Core/Core.h>
11#include <optional>
12namespace ml
13{
39 {
40 protected:
50 virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
51
52 public:
58 virtual void update();
59
68 virtual void eventHandler(const std::optional<sf::Event>& event);
69
79 virtual sf::FloatRect getGlobalBounds() const override;
80
86 virtual void setPosition(const sf::Vector2f& position) override;
87
93 virtual sf::Vector2f getPosition() const override;
94 };
95
96} // namespace ml
97
98#endif // MALENA_UICOMPONENTADAPTER_H
Concrete adapter that gives Core a default virtual interface.
Definition CoreAdapter.h:39
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:69
#define MALENA_API
Definition Component.h:22
Rect< float > FloatRect
Vector2< float > Vector2f