7WSUENFMRX2SL2C7TSIBJWUNEBXBOFCTWGZQ4VMTA5SNENMSFRGAC MKHQJRD2BRE7ID2A6CUOZM45JY2NYNGY3JAUO7EBKGFJFXPR72KQC TKKXEQVO6AFWINUWDTTZVFIMAVDLSLYO3E34TWMDAHUXNOFSEYWQC HTXORJM23W2MSNHZYF7UJCLSHY3A5LT6IXCNZPM35DHEKFKCIOHAC J2DMH3IQU7KKKMKOG7NCUV2FDXW43CF2GFUXRTSYGGJ76MSY2TZQC N2NUGNN4E37TNLC6JZE4H4HKJZPNVBV4VYTLXW57AP5BOU4ZK7LQC KHPSHJN4BMTJ3CHUFQQZU7ZIQDOQDF3L5HV3TRT5OJMYICJAEB5QC OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC U5NDH6ILEWMRMTEKXBLGPEXSJBGNXTWUXKBVOCQG37VRQFFIW2IAC G7GYLDYI2ALVUYHWDXEOAHBVPFUI6TZXOC2XC5PMPWBV4H2KXC6AC GEPM7HZAZ2B53M3LKHAZWWUUMLGX7F3NH4IZOI7UKV6UOZXZZXDQC W6EAMTOM5UG3KXZ7R2P43W5XVTN5GZATZ5ABSDAVVYF7MANDUCTAC KZ6U7UG23CLMTFQRXIRMLBSCAEVY5SWUD7IDPCLVEKAQKXQR3MFQC H3774IWTCFXRZ4PH2QD5SVQYXJCZHPADKLBMJO3FFPUZKOBPLYDAC VYU7DLVELUMUVDGUZEZCEG7YXX4HSLTAGIBHCGPEZ5KFQTGYGGBQC NCSQ5FPI5NSJR3UDSXBUHUXJ2HPEVTYEVALFYAXCPO5FKRLRY7EQC if love.filesystem.getInfo('config') thenlocal settings = json.decode(love.filesystem.read('config'))local width, height, flags = App.screen.size()flags.resizable = trueflags.minwidth = math.min(width, 200)flags.minheight = math.min(height, 200)App.screen.flags = flagsApp.screen.width = settings.widthApp.screen.height = settings.heightApp.screen.resize(App.screen.width, App.screen.height, App.screen.flags)App.screen.move(settings.x, settings.y, settings.displayindex)if on.load_settings then on.load_settings(settings.app) end
local settings = json.decode(love.filesystem.read('config'))_, _, App.screen.flags = App.screen.size()App.screen.flags.resizable = trueApp.screen.width, App.screen.height = settings.width, settings.heightApp.screen.resize(App.screen.width, App.screen.height, App.screen.flags)set_window_position_from_settings(settings)if on.load_settings then on.load_settings(settings.app) endendfunction set_window_position_from_settings(settings)local os = love.system.getOS()if os == 'Linux' then-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.App.screen.move(settings.x, settings.y-37, settings.displayindex)
Font_height = 20love.graphics.setFont(love.graphics.newFont(Font_height))local os = love.system.getOS()if os == 'Android' or os == 'iOS' then-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7-- no point second-guessing window dimensions on mobileApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()else-- maximize windowApp.screen.resize(0, 0) -- maximizeApp.screen.width, App.screen.height, App.screen.flags = App.screen.size()-- shrink height slightly to account for window decorationApp.screen.height = App.screen.height-100App.screen.width = 40*App.width('m')App.screen.flags.resizable = trueApp.screen.flags.minwidth = math.min(App.screen.width, 200)App.screen.flags.minheight = math.min(App.screen.height, 200)App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)endif on.load_settings then on.load_settings() end
App.screen.move(settings.x, settings.y, settings.displayindex)
-- Initialize window width/height and make window resizable.---- I get tempted to have opinions about window dimensions here, but they're-- non-portable:-- - maximizing doesn't work on mobile and messes things up-- - maximizing keeps the title bar on screen in Linux, but off screen on-- Windows. And there's no way to get the height of the title bar.-- It seems more robust to just follow LÖVE's default window size until-- someone overrides it.
function initialize_default_settings()local font_height = 20love.graphics.setFont(love.graphics.newFont(font_height))initialize_window_geometry(App.width('m'))endfunction initialize_window_geometry(em_width)