Home | All Classes | Grouped Classes | Index | Search
Returns the drawn width of a character or string.
int get_width(
unsigned char letter);
int get_width(
const std::string& str, const CL_Size& max_size = CL_Size(0, 0), const std::string& delim = std::string(" "));
int get_width(
const std::string::const_iterator& start, const std::string::const_iterator& end, const CL_Size& max_size = CL_Size(0, 0), const std::string& delim = std::string(" "));
Parameters:
Return value:
The width in pixels.
Detailed description:
It's important to note that newlines have no width, unless you specify a glyph for them in the sprite (which is pretty useless anyways). Other unknown characters have the width of a space.
See also: