Draw custom graphics?

Hi all,
I have a project with ESP32 and ILI9844 LCD. It’s mostly working, though having a little trouble with drawing sprites cleanly. Since I’m planning on using LVGL for some parts of the project anyway, I was wondering if I can use LVGL to draw this kind of thing:

https://imgur.com/gallery/HKP3Cpa

If it’s possible, could someone point me in the direction of a tutorial or wiki that covers this, please? Even just the name of the functions so I can research them myself. :slight_smile:

Happy new year,
Dax.

Hey gang,
Any thoughts on this for a LVGL newbie, please?

I would start with an image asset and display that using the lv_img widget.

You can use a transformation to rotate the image along a pivot point.

If you create the asset so that the top-left corner is the main point of the triangle and pivot point, you can use lv_obj_set_pos to easily move it to the right position.

    LV_IMG_DECLARE(img_asset);
    lv_obj_t * img = lv_img_create(lv_scr_act());
    lv_img_set_src(img, &img_asset);

    lv_img_set_pivot(img, 0, 0);  // 0;0 is the top left corner.
    lv_img_set_angle(img, 450);   // rotate 45 degrees
    lv_obj_set_pos(img, 10, 20);  // move to coordinate 10;20

I hope you get the idea.

@fvanroie, thank you so much for taking the time to write about these. I truly appreciate it!

Also, that’s great news. I’ll read through all of the links you provided and give it a shot.

Thanks again and happy new year. :slight_smile:
-Dax.