d976595879
Main / Build (BookPlayer) (push) Has been cancelled
Main / Build (Brainfuck) (push) Has been cancelled
Main / Build (Breakout) (push) Has been cancelled
Main / Build (Calculator) (push) Has been cancelled
Main / Build (Diceware) (push) Has been cancelled
Main / Build (EpubReader) (push) Has been cancelled
Main / Build (GPIO) (push) Has been cancelled
Main / Build (GraphicsDemo) (push) Has been cancelled
Main / Build (HelloWorld) (push) Has been cancelled
Main / Build (M5UnitTest) (push) Has been cancelled
Main / Build (Magic8Ball) (push) Has been cancelled
Main / Build (MediaKeys) (push) Has been cancelled
Main / Build (MystifyDemo) (push) Has been cancelled
Main / Build (SerialConsole) (push) Has been cancelled
Main / Build (Snake) (push) Has been cancelled
Main / Build (TamaTac) (push) Has been cancelled
Main / Build (TodoList) (push) Has been cancelled
Main / Build (TwoEleven) (push) Has been cancelled
Main / Bundle (push) Has been cancelled
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
#include "GameKitDraw.h"
|
|
|
|
namespace GameKit {
|
|
|
|
lv_obj_t* makePanel(lv_obj_t* parent, lv_color_t color, uint8_t radius) {
|
|
lv_obj_t* obj = lv_obj_create(parent);
|
|
lv_obj_set_style_bg_color(obj, color, LV_PART_MAIN);
|
|
lv_obj_set_style_border_width(obj, 0, LV_PART_MAIN);
|
|
lv_obj_set_style_radius(obj, radius, LV_PART_MAIN);
|
|
lv_obj_set_style_pad_all(obj, 0, LV_PART_MAIN);
|
|
lv_obj_remove_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
|
return obj;
|
|
}
|
|
|
|
lv_obj_t* makeCell(lv_obj_t* parent, uint16_t size, lv_color_t color, uint8_t radius) {
|
|
lv_obj_t* obj = makePanel(parent, color, radius);
|
|
lv_obj_set_size(obj, size, size);
|
|
return obj;
|
|
}
|
|
|
|
lv_obj_t* makeLabel(lv_obj_t* parent, const char* text, lv_color_t color) {
|
|
lv_obj_t* label = lv_label_create(parent);
|
|
lv_label_set_text(label, text);
|
|
lv_obj_set_style_text_color(label, color, LV_PART_MAIN);
|
|
return label;
|
|
}
|
|
|
|
void setCell(lv_obj_t* obj, int x, int y, uint16_t cellPx) {
|
|
lv_obj_set_pos(obj, x * cellPx, y * cellPx);
|
|
}
|
|
|
|
} // namespace GameKit
|