2

I want to run an app in fullscreen. Here is what I found so far:

if __name__ == '__main__':
    lib_app = app.App()
    res = player.getScreenResolution()
    lib_app.run(MainDiv(), app_resolution=''+str(res.x)+'x'+str(res.y))

The size is correct, but the window is not fullscreen. Additionally the fullscreen-button is disabled. There is another function I played with: setResolution

if __name__ == '__main__':
    lib_app = app.App()
    res = player.getScreenResolution()
    # setResolution(fullscreen, width, height, bpp) bpp=16 or 24 is valid
    player.setResolution(True, int(res.x), int(res.y), 16) 
    lib_app.run(MainDiv())

But when I run this version the code is ignored.

How can I make it to start in fullscreen?

4

1 回答 1

2

经过一番研究,我找到了一个解决方案,我想与您分享:app.run() 可以有几个设置,它有一个全屏选项

if __name__ == '__main__':
    lib_app = app.App()
    res = player.getScreenResolution()
    lib_app.run(MainDiv(), app_fullscreen='True', app_resolution=''+str(res.x)+'x'+str(res.y))

设置的完整列表没有记录,也无法在 settings.Settings 中找到,正如run的文档所暗示的那样,但可以在 github的app代码中找到。

self._settings.addOption(Option('app_windowconfig', ''))
self._settings.addOption(Option('app_resolution', '640x480'))
self._settings.addOption(Option('app_window_size', ''))
self._settings.addOption(Option('app_fullscreen', 'false'))
self._settings.addOption(Option('app_show_cursor', 'true'))
self._settings.addOption(Option('app_rotation', 'normal'))
self._settings.addOption(Option('app_panel_fontsize', '10'))
self._settings.addOption(Option('app_mouse_enabled', 'true'))
self._settings.addOption(Option('multitouch_enabled', 'false'))
self._settings.addOption(Option('multitouch_driver', ''))
self._settings.addOption(Option('multitouch_tuio_port', ''))
self._settings.addOption(Option('log_avg_categories', ''))

请注意,这些值是字符串。

于 2015-09-25T09:16:46.357 回答