A very basic question I’m afraid. I want to draw some circles to show which screen is active. So far I’ve tried using LEDs, and an arc, but I’m not getting what I want with either. I just want a filled circle (perhaps with a border?) that I can set to a certain color. Would it be possible to demonstrate how to do this in C? Thanks all!
For what it’s worth, this was what I arrived at. Welcome to comments or advice for improvements:
// 6. LED Special Section!
// LED Styles
static lv_style_t style_dot_on;
lv_style_init(&style_dot_on);
lv_style_set_border_color(&style_dot_on, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x00, 0xc3, 0xe8)); // { Blue , Red, Green }
lv_style_set_shadow_color(&style_dot_on, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x00, 0xc3, 0xe8));
lv_style_set_shadow_width(&style_dot_on, LV_STATE_DEFAULT, 0);
lv_style_set_border_width(&style_dot_on, LV_STATE_DEFAULT, 1);
lv_style_set_bg_color(&style_dot_on, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x00, 0xc3, 0xe8));
lv_style_set_bg_grad_color(&style_dot_on, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x00, 0xc3, 0xe8));
// lv_style_set_border_opa(&style_dot_on, LV_STATE_DEFAULT, LV_OPA_30);
lv_style_set_radius(&style_dot_on, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
static lv_style_t style_dot_off;
lv_style_copy(&style_dot_off, &style_dot_on);
lv_style_set_bg_color(&style_dot_off, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xff, 0xff));
lv_style_set_bg_grad_color(&style_dot_off, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xff, 0xff));
/* The ON LED */
#define RADIUS ( 12 )
#define SPACING ( RADIUS * 1.6 )
#define POS_ZERO_OFFSET ( -(MAX_NUM_PAGES - 1) * SPACING / 2 )
uint32_t offset = POS_ZERO_OFFSET;
lv_obj_add_style(iconProgressDots[0], LV_LED_PART_MAIN, &style_dot_on);
lv_obj_align(iconProgressDots[0], NULL, LV_ALIGN_IN_BOTTOM_MID, offset, 0);
lv_obj_set_size(iconProgressDots[0], RADIUS, RADIUS);
lv_led_set_bright(iconProgressDots[0], 255);
/* OFF LEDs */
for (i = 1; i < MAX_NUM_PAGES; i++) {
offset += SPACING;
lv_obj_add_style(iconProgressDots[i], LV_LED_PART_MAIN, &style_dot_off);
lv_obj_align(iconProgressDots[i], NULL, LV_ALIGN_IN_BOTTOM_MID, offset, 0);
lv_obj_set_size(iconProgressDots[i], RADIUS, RADIUS);
lv_led_set_bright(iconProgressDots[i], 255);
}