pmp-p / pygame-wasm

WIP: repo for upstreaming wasm version of pygame, use case pygbag: https://pygame-web.github.io
https://pmp-p.github.io/pygame-wasm/
7 stars 1 forks source link

fullscreen #3

Open pmp-p opened 2 years ago

pmp-p commented 2 years ago

pygame.display.toggle_fullscreen() SystemError: returned NULL without setting an exception

but

pygame.display.set_mode((0, 0), pygage.FULLSCREEN) is working.

problem : when exiting fullscreen game (with ESC) it does not refit to expand full canvas

DaniMorales97 commented 2 years ago

I don't know if this issue is still going on, as in my case my game opens up occupying all of the browser's window.

Please tell me if it's help is still needed in this subject and I'll take a look.

pmp-p commented 2 years ago

fullscreen is an explicit request to browser, and there's a prompt and it requires a user confirmation it's a bit different than full screen in a window or with F11 the SystemError is probably coming from a defect in SDL2 wasm port

DaniMorales97 commented 2 years ago

I thought that maybe using ondblclick event could solve this issue. Using some js function to go into fullscreen and out of it when double clicking on the iframe. I still don't know how to code that, but if I eventually do I'll fix it and PR.

Saw a possible implementation on the html here: https://stackoverflow.com/a/4421040