le2d v0.4.7
2D game engine framework
 
Loading...
Searching...
No Matches
le::LineInput Class Reference

Interactive text input for a single line. More...

#include <le2d/text/line_input.hpp>

Public Member Functions

 LineInput (gsl::not_null< IFont * > font, TextHeight height=TextHeight::Default)
 
auto get_string () const -> std::string_view
 
auto get_height () const -> TextHeight
 
auto get_cursor () const -> int
 
auto get_cursor_x () const -> float
 
auto get_size () const -> glm::vec2
 
auto get_glyph_layouts () const -> std::span< kvf::ttf::GlyphLayout const >
 
auto get_atlas () const -> IFontAtlas &
 
auto get_texture () const -> ITexture const &
 
auto to_primitive () const -> Primitive
 
void set_string (std::string line)
 
void append (std::string_view str)
 
void write (char ch)
 
void backspace ()
 
void delete_front ()
 
void set_cursor (int cursor)
 
void move_cursor (int delta)
 

Protected Member Functions

void update ()
 

Detailed Description

Interactive text input for a single line.

Constructor & Destructor Documentation

◆ LineInput()

le::LineInput::LineInput ( gsl::not_null< IFont * >  font,
TextHeight  height = TextHeight::Default 
)
explicit

Member Function Documentation

◆ append()

void le::LineInput::append ( std::string_view  str)

◆ backspace()

void le::LineInput::backspace ( )

◆ delete_front()

void le::LineInput::delete_front ( )

◆ get_atlas()

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

◆ get_cursor()

auto le::LineInput::get_cursor ( ) const -> int
inline

◆ get_cursor_x()

auto le::LineInput::get_cursor_x ( ) const -> float
inline

◆ get_glyph_layouts()

auto le::LineInput::get_glyph_layouts ( ) const -> std::span<kvf::ttf::GlyphLayout const>
inline

◆ get_height()

auto le::LineInput::get_height ( ) const -> TextHeight
inline

◆ get_size()

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

◆ get_string()

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

◆ get_texture()

auto le::LineInput::get_texture ( ) const -> ITexture const&
inline

◆ move_cursor()

void le::LineInput::move_cursor ( int  delta)

◆ set_cursor()

void le::LineInput::set_cursor ( int  cursor)

◆ set_string()

void le::LineInput::set_string ( std::string  line)

◆ to_primitive()

auto le::LineInput::to_primitive ( ) const -> Primitive

◆ update()

void le::LineInput::update ( )
protected

◆ write()

void le::LineInput::write ( char  ch)

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