What MCU/Processor/Board and compiler are you using?
ESP32S3
What LVGL version are you using?
LVGL 8
What do you want to achieve?
Move the background image of an object with the object
My code works, no problem. But if I want to move “screen1” which has the background “gauge1Background” I cannot. I can move meter1 but the background never moves. I’d like to be able to move meter1 and gauge1Background together… I’d like to just move screen1 down 50px…
I have tried this to no avail:
lv_obj_align(screen1, LV_ALIGN_CENTER, 0, 50);
Here’s my code
LV_IMG_DECLARE(gauge1Background);
screen1 = lv_obj_create(NULL); // Create a blank
lv_obj_set_size(screen1, 480, 480);
lv_obj_align(screen1, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_style_bg_img_src(screen1, &gauge1Background, LV_PART_MAIN | LV_STATE_DEFAULT);
meter1 = lv_meter_create(screen1); // Create the meter
lv_obj_center(meter1); // Center it on the screen
lv_obj_remove_style(meter1, NULL, LV_PART_MAIN);
lv_obj_remove_style(meter1, NULL, LV_PART_INDICATOR);
lv_obj_set_size(meter1, 480, 480);