Issue setting Kivy to fullscreen

后端 未结 6 1891
一个人的身影
一个人的身影 2021-02-20 12:42

I\'m trying to write an application that runs kivy at full screen. But these are my issues:

1) When I run the command:

#Config.set(\'graphics\', \'fullsc         


        
相关标签:
6条回答
  • 2021-02-20 13:01

    Try

    from kivy.core.window import Window
    Window.fullscreen = True
    

    Do this before you App.run() method, and it should switch to fullscreen mode.

    Cheers

    0 讨论(0)
  • 2021-02-20 13:02

    I just want to complement:

    from kivy.core.window import Window
    Window.size = (1366, 768)
    Window.fullscreen = True
    
    0 讨论(0)
  • 2021-02-20 13:10

    I managed to do it as follows:

    from kivy.core.window import Window
    Window.maximize()
    
    0 讨论(0)
  • 2021-02-20 13:12

    Answering lately For those who are still struggling to figure out how to have the true fullscreen. I have managed to get the rid of those black strip by adding Config.set('graphics','window_state'_'maximized' just after the fullscreen call. the whole code looks like

    from kivy.config import Config
    
    # ...
    
    if __name__ == "__main__":
    
        Config.set('graphics', 'fullscreen', 'auto')
        Config.set('graphics', 'window_state', 'maximized')
        Config.write()
        YourApp().run()
    
    0 讨论(0)
  • 2021-02-20 13:18

    this works for me:

    Config.set('graphics', 'fullscreen', 'auto')
    
    0 讨论(0)
  • 2021-02-20 13:27

    Had a similar problem. Using the 'auto' option got rid of the bands for me.

    Window.fullscreen = 'auto'
    

    Quote from Kivy Configuration Object documentation: "If set to auto, your current display’s resolution will be used instead. This is most likely what you want."

    0 讨论(0)
提交回复
热议问题