Currently experimenting with this and creating my own widgets but also noticed if for example I add multiple of the same widget in the mainDraw() function will end up with multiple copies of the exact same code.
Hence if instead widgets were output as functions with parameters
for example
void digitalclock(int h, int m, int center_x, int center_y, in size)
{
for (int i = 0; i < 60; ++i) {
if (i % 5 == 0)
display.drawThickLine(widget0_center_x + widget0_r1 * cos((double)i / 60.0 * 2.0 * 3.14159265),
widget0_center_y + widget0_r1 * sin((double)i / 60.0 * 2.0 * 3.14159265),
widget0_center_x + widget0_r3 * cos((double)i / 60.0 * 2.0 * 3.14159265),
widget0_center_y + widget0_r3 * sin((double)i / 60.0 * 2.0 * 3.14159265), 0, 3);
else if (widget0_size > 150)
.... <cut rest of digitalclock implementation>
}
In mainDraw() could then add
digitalclock(10,20,82,544,64);
digitalclock(11,20,28,154,64);
Currently experimenting with this and creating my own widgets but also noticed if for example I add multiple of the same widget in the mainDraw() function will end up with multiple copies of the exact same code.
Hence if instead widgets were output as functions with parameters
for example
In mainDraw() could then add