Files
ESP8266lib/ext/lcd/ui/UIPainter.h
kazu 5cb02880b3 many updates..
new sensors.. display.. led.. drawing.. stuff..
2019-01-17 23:12:01 +01:00

53 lines
1.1 KiB
C++

#ifndef UI_PAINTER_H
#define UI_PAINTER_H
#include "../../../Debug.h"
#include "../Draw.h"
#include "UIStructs.h"
class Setter;
class FontWrap;
extern FontWrap fnt_f1;
extern Setter setter;
class UIPainter {
public:
void drawLine(const uint16_t x1, const uint16_t y1, const uint16_t x2, const uint16_t y2) {
debugMod("UI", "draw line");
drawer.drawLine(x1,y1, x2,y2);
}
void drawLineHor(const uint16_t x1, const uint16_t x2, const uint16_t y) {
drawer.drawLineHor(x1,x2,y);
}
void drawLineVer(const uint16_t y1, const uint16_t y2, const uint16_t x) {
drawer.drawLineVer(y1,y2,x);
}
void drawRect(UIRect r) {
drawer.drawRect(r.x, r.y, r.w, r.h);
}
void drawText(const uint16_t x, const uint16_t y, const char* str) {
fnt_f1.draw(str, x, y, setter);
}
void setFG(const Color fg) {
drawer.setColor(fg);
}
void fillRect(const UIRect rect) {
drawer.fillRect(rect.x, rect.y, rect.w, rect.h);
}
void fillRect(const uint16_t x, const uint16_t y, const uint16_t w, const uint16_t h) {
drawer.fillRect(x,y,w,h);
}
};
#endif // UI_PAINTER_H