There is a difference between the CodeBlocks and Visual Studio projects, and it looks like some things are getting mixed up.
USE_MONITOR (and the MONITOR_XXX settings) control the SDL driver. This is what the Visual Studio project uses. I think that @il3ven is looking for MONITOR_HOR_RES and MONITOR_VER_RES.
USE_WINDOWS (and the WINDOW_XXX settings) control the native Windows driver, which I quickly wrote about 9 months ago to ease the learning curve for Windows users (who often have difficulties getting SDL/Visual Studio working). That driver is currently only used with the CodeBlocks project.
I’m not sure how, with default settings, @tarvik managed to get their screen to resize using the USE_WINDOWS options (unless they had already switched to the Windows driver, **or they were using CodeBlocks).
You move the button up with 40 px, and now it’s partially out of the screen. It seems correct to me.
Try lv_obj_align(btn1, NULL, LV_ALIGN_CENTER, 0, 0);
Keen in mind, lv_obj_align should be called when the size of the object is set. If you add a label and the button has LV_FIT_TIGHT, the button’s size will change according to the label size. So just add lv_obj_align after adding the label.
This problem has partially been solved. Thank you all for your help.
To fit the button on screen I used lv_obj_set_width(). This has solved my problem for now.
I was expecting LittlevGL to resize the button automatically according to my screen size. Therefore I was thinking that maybe I have not set my resolution correctly.
This is my solution to properly fit a button.
lv_obj_t * btn1 = lv_btn_create(scr, NULL);
lv_obj_set_width(btn1, LV_HOR_RES); //Button width is set to maximum
lv_obj_set_height(btn1, LV_DPI/7); //Button takes 1/7th of an inch
lv_obj_align(btn1, label1, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); //This properly aligns my button corresponding to label1