I tried to modify fe.layout.width and height, but it doesn't affect the aspect ratio, which I guess is normal...
To fix the aspect ratio of your layout on any screen:
- set your layout size to the screensize
- draw everything on a surface of the size you want, set keep_aspect_ratio of the surface to true.
In the following example, the aspect ratio is determined by surfaceWidth and surfaceHeight, and I set those using the height of the display as a reference.
//top of your layout:
fe.layout.width=ScreenWidth;
fe.layout.height=ScreenHeight;
local screenAspect=(1.0*ScreenWidth)/ScreenHeight;
local layoutAspect=4.0/3.0;
local surfaceWidth=layoutAspect*ScreenHeight;
local surfaceHeight=ScreenHeight;
local fs=fe.add_surface(surfaceWidth,surfaceHeight)
fs.preserve_aspect_ratio=true;
fs.set_pos(0,0,ScreenWidth,ScreenHeight);
//now draw all your stuff using fs.xxx instead of fe.xxx