Confusion regarding multiple screens

Hi,
I am having confusion regarding using multiple screens and managing them.
Creating a screen is fine, but what and how to initialize it? Like in below code I have created a screen:

    main_menu_scr = lv_cont_create(NULL, NULL);
	lv_obj_set_size(main_menu_scr, 180, 180);
	lv_obj_align(main_menu_scr, sys_bg_obj, LV_ALIGN_CENTER, 0, 5);
	lv_obj_set_style_local_border_width(main_menu_scr, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
	lv_obj_set_style_local_radius(main_menu_scr, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);

But but when I try to load it using lv_scr_load it crashes, I tried to debug it (I am suing simulator for the designing) I cashes at the lv_obj_align in the above code.

lets say a screen has some animations. I init it, but the animations starts running obviously. What I want is when the screen gets loaded then only the animations should start. So is there any specific nice way to achieve that or i have to put the logic together myself?

Also what does the “init” of a screen should contain and should not? I also found there is no much documentation on using multiple screens and managing them in the docs, please point me to some examples or code chunks.

Thumbs up to the great library :slight_smile: It took me so little time to understand so many things of lvgl but this is where I got stuck.

Hi,

The problem is really here

You can not change the position and size of the screens.