21 #include <SFML/UI/Component.hpp>
22 #include <SFML/UI/IText.hpp>
49 Label(sf::Texture
const &image);
60 Label(sf::Font
const &font, sf::String
const &text,
int fontSize = 35);
92 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
110 virtual const sf::String&
getText()
const;
120 virtual void setText(sf::String
const &text);
127 virtual const sf::Font*
getFont()
const;
134 virtual void setFont(sf::Font
const &font);
174 const sf::Texture*
getImage()
const;
182 void setImage(sf::Texture
const &image);
189 virtual sf::Vector2f
getSize()
const;
virtual void setText(sf::String const &text)
Sets the text's string of the component Don't forget to set the font.
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draw the component to the render target.
virtual sf::Vector2f getSize() const
void setImage(sf::Texture const &image)
Sets the label's image Similar to setTexture(sf::Texture const&)
virtual void updateCoord()
Called when the component need update its geometry Inherit when you need to update some sprite...
A label which show text or image.
virtual const sf::String & getText() const
virtual void updateFixed(sf::Time delta)
Update the component with the main loop's frequency Can be useful for animation, or time's needed stu...
virtual void updateEvent(sf::Event const &event)
Update the component each time an event has been polled.
Label()
Creates an empty label.
The base class for all UI components.
virtual const sf::Font * getFont() const
An interface that allow component to have a text.
virtual sf::Color getFontColor() const
virtual void setFont(sf::Font const &font)
Sets the font of the component's text.
const sf::Texture * getImage() const
virtual void setFontColor(sf::Color color)
Sets the color's font of the text.
virtual void setFontSize(unsigned int size)
Set the font's size of the component.
virtual unsigned int getFontSize() const