Bugz Door Project
|
Rendering a string with ANSIColor. More...
#include <door.h>
Public Member Functions | |
Render (const std::string txt) | |
void | append (ANSIColor color, int len=1) |
void | output (std::ostream &os) |
Public Attributes | |
std::vector< ColorOutput > | outputs |
Vector of ColorOutput object. | |
Private Attributes | |
std::string | text |
Complete text to be rendered. | |
Rendering a string with ANSIColor.
This holds the string, and a vector that contains ColorOutput parts.
door::Render::Render | ( | const std::string | txt | ) |
Construct a new Render:: Render object
Render consists of constant text, and vector of ColorOutput
txt | Text |
void door::Render::append | ( | ANSIColor | color, |
int | len = 1 |
||
) |
Create render output.
Call this for each section you want to colorize.
color | |
len |
void door::Render::output | ( | std::ostream & | os | ) |
Output the Render.
This consists of going through the vector, getting the fragment (from pos and len), and outputting the color and fragment.
os |