Search code examples
pythonpygamepygbag

How to make full screen mode in pygbag?


When I open the pygame html page created with pygbag, the console opens in full screen and the pygame window is in the corner: (see image below)

How can I make the pygbag window open in full screen?

1


Solution

  • Short answer, you cannot, no web browser will allow your code to switch to fullscreen on page load without user intervention.

    So now the default in pygbag is "fullscreen windowed" : that way pygame screen is always maximized inside the page which seems a good trade off.

    To get console back, just add #debug to the url

    but once user is -already- interacting with pygame, you can call real full screen via python with same code you would use on desktop.