nngn
Loading...
Searching...
No Matches
nngn::Text Struct Reference

#include <text.h>

Collaboration diagram for nngn::Text:

Public Member Functions

constexpr Text ()=default
 
 Text (const Font &f, std::string_view s)
 
 Text (const Font &f, std::string_view s, size_t cur)
 
void update_cur (const Font &f, size_t cur)
 
void update_size (const Font &f)
 

Static Public Member Functions

static size_t count_lines (std::string_view s, size_t cur)
 
static float max_width (const Font::Characters &font, std::string_view s, size_t cur)
 

Public Attributes

std::string str = {}
 
size_t cur = 0
 
size_t nlines = 0
 
float spacing = 0
 
vec2 size = {0, 0}
 

Constructor & Destructor Documentation

◆ Text() [1/3]

nngn::Text::Text ( )
constexprdefault

◆ Text() [2/3]

nngn::Text::Text ( const Font & f,
std::string_view s )
inline

◆ Text() [3/3]

nngn::Text::Text ( const Font & f,
std::string_view s,
size_t cur )
inline
Here is the call graph for this function:

Member Function Documentation

◆ count_lines()

std::size_t nngn::Text::count_lines ( std::string_view s,
size_t cur )
static
Here is the caller graph for this function:

◆ max_width()

float nngn::Text::max_width ( const Font::Characters & font,
std::string_view s,
size_t cur )
static
Here is the caller graph for this function:

◆ update_cur()

void nngn::Text::update_cur ( const Font & f,
size_t cur )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_size()

void nngn::Text::update_size ( const Font & f)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cur

size_t nngn::Text::cur = 0

◆ nlines

size_t nngn::Text::nlines = 0

◆ size

vec2 nngn::Text::size = {0, 0}

◆ spacing

float nngn::Text::spacing = 0

◆ str

std::string nngn::Text::str = {}

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