nngn
Loading...
Searching...
No Matches
nngn::Textbox Class Reference

#include <textbox.h>

Collaboration diagram for nngn::Textbox:

Classes

struct  Command
 

Public Types

enum  Flag : u8 { UPDATED = 1u << 0 , SCREEN_UPDATED = 1u << 1 , MONOSPACED = 1u << 2 }
 

Public Member Functions

void init (const Fonts *f)
 
bool empty (void) const
 
std::size_t text_length (void) const
 
bool monospaced (void) const
 
bool updated (void) const
 
bool finished (void) const
 
void set_monospaced (bool m)
 
void set_screen_updated (void)
 
void set_speed (unsigned s)
 
void set_title (const char *s)
 
void set_text (const char *s)
 
void set_cur (std::size_t cur)
 
bool update (const Timing &t)
 
void update_size (void)
 
void update_size (const uvec2 &screen)
 
void clear_updated (void)
 

Static Public Member Functions

static bool is_character (unsigned char c)
 
static bool is_character (char c)
 
static bool is_command (unsigned char c)
 
static bool is_command (char c)
 

Public Attributes

Text str = {}
 
Text title = {}
 
std::chrono::microseconds timer = {}
 
std::chrono::milliseconds speed = DEFAULT_SPEED
 
vec2 title_bl = {0, 0}
 
vec2 title_tr = {0, 0}
 
vec2 str_bl = {0, 0}
 
vec2 str_tr = {0, 0}
 

Static Public Attributes

static constexpr auto DEFAULT_SPEED = std::chrono::milliseconds(50)
 

Private Attributes

Flags< Flagflags = {}
 
const Fontsfonts = nullptr
 

Member Enumeration Documentation

◆ Flag

Enumerator
UPDATED 
SCREEN_UPDATED 
MONOSPACED 

Member Function Documentation

◆ clear_updated()

void nngn::Textbox::clear_updated ( void )
inline
Here is the call graph for this function:

◆ empty()

bool nngn::Textbox::empty ( void ) const
inline
Here is the caller graph for this function:

◆ finished()

bool nngn::Textbox::finished ( void ) const
inline
Here is the caller graph for this function:

◆ init()

void nngn::Textbox::init ( const Fonts * f)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_character() [1/2]

bool nngn::Textbox::is_character ( char c)
inlinestatic
Here is the call graph for this function:

◆ is_character() [2/2]

bool nngn::Textbox::is_character ( unsigned char c)
inlinestatic
Here is the caller graph for this function:

◆ is_command() [1/2]

bool nngn::Textbox::is_command ( char c)
inlinestatic
Here is the call graph for this function:

◆ is_command() [2/2]

bool nngn::Textbox::is_command ( unsigned char c)
inlinestatic
Here is the caller graph for this function:

◆ monospaced()

bool nngn::Textbox::monospaced ( void ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_cur()

void nngn::Textbox::set_cur ( std::size_t cur)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_monospaced()

void nngn::Textbox::set_monospaced ( bool m)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_screen_updated()

void nngn::Textbox::set_screen_updated ( void )
inline
Here is the call graph for this function:

◆ set_speed()

void nngn::Textbox::set_speed ( unsigned s)
inline
Here is the caller graph for this function:

◆ set_text()

void nngn::Textbox::set_text ( const char * s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_title()

void nngn::Textbox::set_title ( const char * s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ text_length()

std::size_t nngn::Textbox::text_length ( void ) const
Here is the call graph for this function:

◆ update()

bool nngn::Textbox::update ( const Timing & t)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_size() [1/2]

void nngn::Textbox::update_size ( const uvec2 & screen)
Here is the call graph for this function:

◆ update_size() [2/2]

void nngn::Textbox::update_size ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updated()

bool nngn::Textbox::updated ( void ) const
inline
Here is the call graph for this function:

Member Data Documentation

◆ DEFAULT_SPEED

auto nngn::Textbox::DEFAULT_SPEED = std::chrono::milliseconds(50)
staticconstexpr

◆ flags

Flags<Flag> nngn::Textbox::flags = {}
private

◆ fonts

const Fonts* nngn::Textbox::fonts = nullptr
private

◆ speed

std::chrono::milliseconds nngn::Textbox::speed = DEFAULT_SPEED

◆ str

Text nngn::Textbox::str = {}

◆ str_bl

vec2 nngn::Textbox::str_bl = {0, 0}

◆ str_tr

vec2 nngn::Textbox::str_tr = {0, 0}

◆ timer

std::chrono::microseconds nngn::Textbox::timer = {}

◆ title

Text nngn::Textbox::title = {}

◆ title_bl

vec2 nngn::Textbox::title_bl = {0, 0}

◆ title_tr

vec2 nngn::Textbox::title_tr = {0, 0}

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