Loading...
Searching...
No Matches
TextInput.h
Go to the documentation of this file.
1#ifndef TEXTINPUT_H
2#define TEXTINPUT_H
3
4#pragma once
5
9
10namespace ml
11{
49 class TextInput : public ml::Core
50 {
51 ml::Typer typer;
52 ml::Cursor cursor;
53
54 protected:
61 void draw(sf::RenderTarget& target, sf::RenderStates states) const;
62
63 public:
65
73 void setPosition(const sf::Vector2f& position) override;
74
79 sf::Vector2f getPosition() const override;
80
88 [[nodiscard]] sf::FloatRect getGlobalBounds() const override;
89
98 // void enableState(Flaggable::State state);
99 };
100
101} // namespace ml
102
103#endif // TEXTINPUT_H
Virtual base class for all Malena framework objects.
Definition Core.h:67
A blinking text cursor used inside TextInput.
Definition Cursor.h:32
void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draw both the Typer and the Cursor to the render target.
void setPosition(const sf::Vector2f &position) override
Set the world-space position of the input field.
sf::Vector2f getPosition() const override
Return the current world-space position of the input field.
sf::FloatRect getGlobalBounds() const override
Return the axis-aligned bounding box of the input field.
An animated text object that accepts keyboard input.
Definition Typer.h:35
Definition Component.h:18
Rect< float > FloatRect
Vector2< float > Vector2f