21 #include <SFML/Graphics.hpp>
22 #include <SFML/UI/ComponentObservable.hpp>
62 virtual void updateEvent(sf::Event
const &event) = 0;
99 void move(sf::Vector2f
const &vector);
108 void move(
float x,
float y);
116 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
175 virtual sf::Vector2f
getSize()
const;
181 sf::Texture
const *m_texture;
Component()
Creates an empty component, without texture.
const sf::Vector2f & getPosition() const
const sf::Texture * getTexture() const
void move(sf::Vector2f const &vector)
Move the component.
The class who call the observers.
The base class for all UI components.
void setTexture(const sf::Texture &texture)
Set the texture of the component.
virtual void updateEvent(sf::Event const &event)=0
Update the component each time an event has been polled.
void setPosition(sf::Vector2f const &position)
Set the component's position.
virtual sf::Vector2f getSize() const
void updateSize()
Update the size of the component Call it when you update your texture after it was set...
virtual void updateCoord()
Called when the component need update its geometry Inherit when you need to update some sprite...
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draw the component to the render target.
virtual void updateFixed(sf::Time delta)=0
Update the component with the main loop's frequency Can be useful for animation, or time's needed stu...