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)
 
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)
 
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/6]

constexpr nngn::Text::Text ( )
constexprdefault

◆ Text() [2/6]

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

◆ Text() [3/6]

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

◆ Text() [4/6]

constexpr nngn::Text::Text ( )
constexprdefault

◆ Text() [5/6]

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

◆ Text() [6/6]

nngn::Text::Text ( const Font f,
std::string_view  s,
size_t  cur 
)

Member Function Documentation

◆ count_lines() [1/2]

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

◆ count_lines() [2/2]

static size_t nngn::Text::count_lines ( std::string_view  s,
size_t  cur 
)
static

◆ max_width() [1/2]

static 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:

◆ max_width() [2/2]

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

◆ update_cur() [1/2]

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

◆ update_cur() [2/2]

void nngn::Text::update_cur ( const Font f,
size_t  cur 
)

◆ update_size() [1/2]

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

◆ update_size() [2/2]

void nngn::Text::update_size ( const Font f)

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: