Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need a way to generate a direct html file that can run directly in the browser, rather than publish it to itch.io #77

Open
Python-ZZY opened this issue Mar 11, 2023 · 6 comments
Labels
enhancement New feature or request next release wip

Comments

@Python-ZZY
Copy link

All I had to do was double-click on one of the resulting files, and I was able to open it in my default browser, and the program worked fine. How do I do like this?
I couldn't ask on discord due to network issues, thanks for your response.

@pmp-p
Copy link
Member

pmp-p commented Mar 11, 2023

This functionnality will only be available around release v1 when everything is stable. a POC is available here with a much smaller python.

@Python-ZZY
Copy link
Author

This functionnality will only be available around release v1 when everything is stable. a POC is available here with a much smaller python.

thanks but how to use it?

@pmp-p
Copy link
Member

pmp-p commented Mar 12, 2023

To be honest it's quite complicated hence keeping that for the end, if you don't get it by yourself meanwhile : you will have to wait.

@e-dong
Copy link

e-dong commented Jan 13, 2024

This is a workaround

  1. Run pygbag with --build and --html to generate html
  2. download files from the cdn and recreate the path locally in your build/web folder
    archives
    └── repo
        ├── index-bi.json
        ├── pkg
        │   └── pygame_static-1.0-cp311-cp311-wasm32_bi_emscripten.whl
        └── repodata.json
    
  3. Start a python web server, python -m http.server 8080
  4. Navigate to server and click the index.html file

@Sinus44
Copy link

Sinus44 commented May 30, 2024

Is there any new information on the issue? I would like to use my pygame application without having to connect to the internet every time I launch it.

@pmp-p
Copy link
Member

pmp-p commented May 30, 2024

@Sinus44 what you want can be achieved without getting in problems running from file:// introduces. You just would have to make a template for a "service worker" than can serve file from cache without connexion or an installable "progressive web app"

those can be done as extensions to current pygbag with templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next release wip
Projects
None yet
Development

No branches or pull requests

4 participants