Loading...
Searching...
No Matches
Graphic.h
Go to the documentation of this file.
1#ifndef GRAPHIC_H
2#define GRAPHIC_H
3
4#pragma once
5
9
10namespace ml
11{
52 template<typename T>
57 class Graphic : public T, public virtual ComponentCore<>
58 {
59 public:
60 using T::T;
61
70 operator const sf::Drawable&() const;
71
73 static T isItText();
75
77
84 template<typename U>
85 explicit Graphic(const U& obj);
86
96 void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
97
107
115 void setPosition(const sf::Vector2f& position) override;
116
124 sf::Vector2f getPosition() const override;
125 };
126
127} // namespace ml
128
129#include "../../../../src/Graphics/Base/Graphic.tpp"
130#endif // SHAPE_H
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
Draw this graphic to an SFML render target.
sf::Vector2f getPosition() const override
Return the current world-space position.
sf::FloatRect getGlobalBounds() const override
Return the axis-aligned bounding box in world space.
Graphic(const U &obj)
Construct from an existing SFML object of type U.
void setPosition(const sf::Vector2f &position) override
Set the world-space position.
Definition Component.h:18
Rect< float > FloatRect
Vector2< float > Vector2f