le2d v0.4.6
2D game engine framework
 
Loading...
Searching...
No Matches
le::drawable::InputText Class Reference

Interactive input text with cursor. More...

#include <le2d/drawable/input_text.hpp>

Inheritance diagram for le::drawable::InputText:
le::RenderInstance le::IDrawable

Public Types

using Params = InputTextParams
 

Public Member Functions

 InputText (gsl::not_null< IFont * > font, Params const &params={})
 
auto get_size () const -> glm::vec2
 
auto get_font () const -> IFont &
 
auto get_atlas () const -> IFontAtlas &
 
auto is_interactive () const -> bool
 
void set_interactive (bool interactive)
 
auto get_string () const -> std::string_view
 
void set_string (std::string line)
 
void append (std::string_view str)
 
void write (char ch)
 
void backspace ()
 
void delete_front ()
 
void clear ()
 
auto get_cursor () const -> int
 
void set_cursor (int cursor)
 
void move_cursor (int const delta)
 
void cursor_left ()
 
void cursor_right ()
 
void cursor_home ()
 
void cursor_end ()
 
void on_key (event::Key const &key)
 
void on_codepoint (event::Codepoint codepoint)
 
void tick (kvf::Seconds dt)
 
void draw (IRenderer &renderer) const override
 

Additional Inherited Members

- Public Attributes inherited from le::RenderInstance
Transform transform {}
 
kvf::Color tint {kvf::white_v}
 

Detailed Description

Interactive input text with cursor.

Member Typedef Documentation

◆ Params

Constructor & Destructor Documentation

◆ InputText()

le::drawable::InputText::InputText ( gsl::not_null< IFont * >  font,
Params const &  params = {} 
)
explicit

Member Function Documentation

◆ append()

void le::drawable::InputText::append ( std::string_view  str)

◆ backspace()

void le::drawable::InputText::backspace ( )

◆ clear()

void le::drawable::InputText::clear ( )

◆ cursor_end()

void le::drawable::InputText::cursor_end ( )
inline

◆ cursor_home()

void le::drawable::InputText::cursor_home ( )
inline

◆ cursor_left()

void le::drawable::InputText::cursor_left ( )
inline

◆ cursor_right()

void le::drawable::InputText::cursor_right ( )
inline

◆ delete_front()

void le::drawable::InputText::delete_front ( )

◆ draw()

void le::drawable::InputText::draw ( IRenderer renderer) const
overridevirtual

Implements le::IDrawable.

◆ get_atlas()

auto le::drawable::InputText::get_atlas ( ) const -> IFontAtlas&
inline

◆ get_cursor()

auto le::drawable::InputText::get_cursor ( ) const -> int
inline

◆ get_font()

auto le::drawable::InputText::get_font ( ) const -> IFont&
inline

◆ get_size()

auto le::drawable::InputText::get_size ( ) const -> glm::vec2
inline

◆ get_string()

auto le::drawable::InputText::get_string ( ) const -> std::string_view
inline

◆ is_interactive()

auto le::drawable::InputText::is_interactive ( ) const -> bool
inline

◆ move_cursor()

void le::drawable::InputText::move_cursor ( int const  delta)
inline

◆ on_codepoint()

void le::drawable::InputText::on_codepoint ( event::Codepoint  codepoint)

◆ on_key()

void le::drawable::InputText::on_key ( event::Key const &  key)

◆ set_cursor()

void le::drawable::InputText::set_cursor ( int  cursor)

◆ set_interactive()

void le::drawable::InputText::set_interactive ( bool  interactive)

◆ set_string()

void le::drawable::InputText::set_string ( std::string  line)

◆ tick()

void le::drawable::InputText::tick ( kvf::Seconds  dt)

◆ write()

void le::drawable::InputText::write ( char  ch)

The documentation for this class was generated from the following file: