GUI
|
Class that provides rendering functions for widgets. More...
#include <Renderer.h>
Public Member Functions | |
Renderer () | |
virtual | ~Renderer () |
void | setFont (ALLEGRO_FONT *font) |
Sets font to be used by text drawing functions. More... | |
void | setBuffer (ALLEGRO_BITMAP *bitmap) |
Color | color (unsigned char r, unsigned char g, unsigned char b) |
Returns Color object to be passed to drawing functions. More... | |
void | setTarget () |
Sets drawing target to the entire buffer bitmap's area. More... | |
void | setTarget (int x, int y, int w, int h) |
Restricts drawing area to the buffer's region. param x Ta. More... | |
void | clear () |
Clears buffer with bakcground color. More... | |
void | drawFilledRect (int x1, int y1, int x2, int y2, Color color) |
void | drawRect (int x1, int y1, int x2, int y2, Color color, int thickness) |
void | drawText (int x, int y, std::string text, Color color) |
void | drawMultilineText (int x, int y, int maxWidth, float lineHeight, std::string text, Color color) |
void | drawLine (int x1, int y1, int x2, int y2, Color color, int thickness) |
int | getTextWidth (std::string text) |
int | getLineHeight () |
Private Attributes | |
ALLEGRO_FONT * | font |
ALLEGRO_BITMAP * | buffer |
ALLEGRO_BITMAP * | targetBitmap |
Class that provides rendering functions for widgets.
Definition at line 14 of file Renderer.h.
Renderer::Renderer | ( | ) |
Definition at line 3 of file Renderer.cpp.
|
virtual |
Definition at line 11 of file Renderer.cpp.
void Renderer::clear | ( | ) |
Clears buffer with bakcground color.
Definition at line 54 of file Renderer.cpp.
Color Renderer::color | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b | ||
) |
Returns Color object to be passed to drawing functions.
Definition at line 26 of file Renderer.cpp.
void Renderer::drawFilledRect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color | ||
) |
Definition at line 59 of file Renderer.cpp.
void Renderer::drawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color, | ||
int | thickness | ||
) |
Definition at line 79 of file Renderer.cpp.
void Renderer::drawMultilineText | ( | int | x, |
int | y, | ||
int | maxWidth, | ||
float | lineHeight, | ||
std::string | text, | ||
Color | color | ||
) |
Definition at line 74 of file Renderer.cpp.
References font.
void Renderer::drawRect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
Color | color, | ||
int | thickness | ||
) |
Definition at line 64 of file Renderer.cpp.
void Renderer::drawText | ( | int | x, |
int | y, | ||
std::string | text, | ||
Color | color | ||
) |
Definition at line 69 of file Renderer.cpp.
References font.
int Renderer::getLineHeight | ( | ) |
Definition at line 89 of file Renderer.cpp.
References font.
int Renderer::getTextWidth | ( | std::string | text | ) |
Definition at line 84 of file Renderer.cpp.
References font.
void Renderer::setBuffer | ( | ALLEGRO_BITMAP * | bitmap | ) |
Definition at line 21 of file Renderer.cpp.
References buffer.
void Renderer::setFont | ( | ALLEGRO_FONT * | font | ) |
Sets font to be used by text drawing functions.
Definition at line 16 of file Renderer.cpp.
References font.
void Renderer::setTarget | ( | ) |
Sets drawing target to the entire buffer bitmap's area.
Definition at line 31 of file Renderer.cpp.
References buffer, and targetBitmap.
void Renderer::setTarget | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Restricts drawing area to the buffer's region. param x Ta.
Definition at line 42 of file Renderer.cpp.
References buffer, and targetBitmap.
|
private |
Definition at line 56 of file Renderer.h.
|
private |
Definition at line 55 of file Renderer.h.
|
private |
Definition at line 57 of file Renderer.h.