How to flip objects without flipping the screen

What MCU/Processor/Board and compiler i am using?

Using the ESP32-S3 Tdisplay-S3 , xtensa-esp32s3-elf-g++.

What LVGL version i am using?

V8.3

What do i want to achieve?

Im trying to invert the meter obj, the goal is to set 2 meters, 1 in each side of the display to show the Voltage and Amperage, the part that gather the data about voltage and amperage is working fine (tested), the problem is when i try to invert the meter obj.

What have i tried so far?

  • Tried add the feature locally in the lvgl files.
  • In LV_METER_SET_SCALE_RANGE, i partially achieved the goal, the visual part of the meter is flipped, but the indicator inst showing in the visible part of the meter.

Code to reproduce

this is the meter that works normally.


        lv_obj_t *meter = lv_meter_create(s_screen.screen_obj);
        lv_obj_align(meter, LV_ALIGN_RIGHT_MID, 80, 0);
        lv_obj_set_size(meter, 165, 165);
        lv_obj_set_style_bg_opa(meter, LV_OPA_0, 0);
        lv_obj_set_style_pad_all(meter, 2, 0);
        lv_obj_remove_style(meter, nullptr, LV_PART_INDICATOR);
        lv_obj_set_style_text_color(meter, lv_palette_main(LV_PALETTE_GREY), 0);

        lv_meter_scale_t *scale = lv_meter_add_scale(meter);
        lv_meter_set_scale_range(meter, scale, 0, 100, 180, 90);
        lv_meter_set_scale_ticks(
            meter, scale, 3, 2, 5, lv_palette_main(LV_PALETTE_GREY));
        lv_meter_set_scale_major_ticks(
            meter, scale, 1, 2, 10, lv_color_hex3(0xeee), 10);

        lv_meter_indicator_t *indic2 = lv_meter_add_arc(
            meter, scale, 10, lv_palette_main(LV_PALETTE_RED), 0);
        lv_meter_set_indicator_end_value(meter, indic2, 50);

the meter that doesnt work is this.

        lv_obj_t *meter1 = lv_meter_create(s_screen.screen_obj);
        lv_obj_align(meter1, LV_ALIGN_LEFT_MID, -80, 0);
        lv_obj_set_size(meter1, 165, 165);
        lv_obj_set_style_bg_opa(meter1, LV_OPA_0, 0);
        lv_obj_set_style_pad_all(meter1, 2, 0);
        lv_obj_remove_style(meter1, nullptr, LV_PART_INDICATOR);
        lv_obj_set_style_text_color(
            meter1, lv_palette_main(LV_PALETTE_GREY), 0);

        lv_meter_scale_t *scale1 = lv_meter_add_scale(meter1);
        lv_meter_set_scale_range(meter1, scale1, 0, 360, -180, -270);
        lv_meter_set_scale_ticks(
            meter1, scale1, 3, 2, 5, lv_palette_main(LV_PALETTE_GREY));
        lv_meter_set_scale_major_ticks(
            meter1, scale1, 1, 2, 10, lv_color_hex3(0xeee), 10);

        lv_meter_indicator_t *indic1 = lv_meter_add_arc(
            meter1, scale1, 10, lv_palette_main(LV_PALETTE_BLUE), 0);
        lv_meter_set_indicator_end_value(meter1, indic1, 100);

Screenshot and/or video

check docu and change this values.

i know that the numbers in the function are wrong, but i cant find any other method to make this obj flip,this was the closest that i got tho flip the meter obj, also, sorry for the late response.

I use this for left right display side

lv_meter_set_scale_range(meterDB2, scale2, +10, -60, 80+30, -6-30);
lv_meter_set_scale_range(meterDB, scale, -60, +10, 80+30, 106);

then i mean must work up and down too.

i tried the code but didn’t work, i can show the numbers in the desired spot but the indicator still goes Left-Right, i need the to go Right-Left.

first two nums in range is values need oposite order , yuo 0 / 100 and 0 / 360 is same orientation.

tried that, but the indicator are still going Left-Right.