21 #include <SFML/UI/Focusable.hpp>
22 #include <SFML/UI/IText.hpp>
54 KeyField(sf::Texture
const &texture, sf::Texture
const &textureFocused, sf::Font
const &font, sf::Keyboard::Key key);
75 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
121 void addKey(sf::Keyboard::Key key);
144 virtual const sf::String&
getText()
const;
155 virtual void setText(sf::String
const &text);
163 virtual const sf::Font*
getFont()
const;
170 virtual void setFont(sf::Font
const &font);
208 sf::Keyboard::Key m_key;
209 std::set<sf::Keyboard::Key> m_keysAllowed;
virtual unsigned int getFontSize() const
virtual void setFontColor(sf::Color color)
Sets the color's font of the text.
The base class for all UI components that can be focused.
bool isKeyAllowed(sf::Keyboard::Key key) const
const std::set< sf::Keyboard::Key > & getAllowedKeys() const
virtual void updateEvent(sf::Event const &event)
Update the component each time an event has been polled.
virtual const sf::Font * getFont() const
void addKey(sf::Keyboard::Key key)
Add a key to the allowed keys set.
virtual void setFont(sf::Font const &font)
Sets the font of the component's text.
virtual void updateFixed(sf::Time delta)
Update the component with the main loop's frequency.
void removeKey(sf::Keyboard::Key key)
Remove the key from the allowed keys set.
An interface that allow component to have a text.
KeyField(sf::Keyboard::Key key)
Creates a key field without textures, which store a (keyboard's) key Do not forget to set the texture...
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draw the component to the render target.
virtual void setFontSize(unsigned int size)
Set the font's size of the component.
virtual void updateCoord()
Called when the component need update its geometry Inherit when you need to update some sprite...
virtual sf::Color getFontColor() const
virtual const sf::String & getText() const
A field that stores a keyboard's key Not supported on mobile platforms.