-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
Let's exchange information to improve Pyxel's web support #404
Comments
Encountered Rust-SDL2/rust-sdl2#1249 when try to build manylinux wheels on Linux with
Progress: https://github.com/messense/pyxel/actions/runs/2903962186 |
@messense Excellent! This trial is really helpful.
Thank you. |
To do that you need to hard code manylinux docker image for each supported Linux targets. Windows and macOS targets can use
It's already doing that. Feel free to copy and edit the workflow to suit your needs. |
I also noticed that there are some dependencies compiled with different versions, for example
|
It seems that new Pyodide has been released 3 days ago. With it, the web version of Pyxel can be improved? |
I just had a look at the the examples on https://kitao.github.io/pyxel/wasm/ and noticed that while controls work immediately once things have finished loading, the sound/music wont start until you click the mouse somewhere on the page. Also pressing escape freezes the game and there's no way to return without refreshing the page. Firefox/MacOS. |
|
I didn't realise that was the default behaviour from the browser, makes sense. I saw the mention of sys.exit/pyxel.quit but just wanted to raise the issue/comment just in case. Apologies for sticking my nose in without doing a thorough enough reading! |
Demo with pyxel-1.8.0-cp37-abi3-emscripten_3_1_14_wasm32.whl : www.pyxelstudio.net |
@notbored |
I've separated the topic for compiling for many platforms on GitHub Actions here: #409 |
I separated embedding Python topic into #412. |
if think pygbag and pygame-script codebase can help on :
but for
-> i can help too but only after pyodide reach 3.11, because loading SDL2 dynamically is tricky and i will do it for pygame only at that moment. ( SDL2 is not meant to be a side module because it's full of JS calls )
-> need serious benchmarking before taking any decision so imho after 3.11 pyodide too. |
Pyxel for WASM builds MEMFS from the specified files like this now. Is there any good way to remove this table? If possible, I'd like to copy necessary files by checking files under the specified origin directory automatically or mount real file system. Current: let pyxel = await loadPyxel("canvas");
await pyxel.loadFiles("../python/pyxel/examples", [
"02_jump_game.py",
"assets/jump_game.pyxres",
]);
pyxel.run("02_jump_game.py"); Ideal: let pyxel = await loadPyxel("canvas");
await pyxel.mount("../python/pyxel/examples");
pyxel.run("02_jump_game.py"); |
pygbag uses zip format (
checking files one by one is not possible on webserver where index is disallowed :( so it is not a bullet proof solution |
@messense https://github.com/kitao/pyxel/blob/main/pyproject.toml
In addition to the above, Maturin looks Cargo.toml-centered design and if the pyptorject.toml is not placed there, some paths such as readme and license also looks strange. For examples, pyproject.toml and license file are in the same directory, but I should wirte
in the pyproject.toml |
@kitao I'm aware of the these unpolished parts of maturin and plan to address them in the upcoming v0.13.3 release. Ideally the current file structure should just work. |
@messense Great. I look forward to new version of Maturin. |
@kitao Please try maturin v0.13.3-beta.6, you can install it by running |
@messense Thank you for your support! |
Fixed in PyO3/maturin#1102, please try maturin v0.13.3-beta.7. |
@messense I confirmed the python directories are included.
But they aren't included though the output said:
|
@messense Though |
Now every example of Pyxel, a retro game engine for Python, works on web browsers! |
@kitao If everything goes well, v0.13.3 will be released this week. |
@messense Thank you. I confirmed it works. I look forward to the next official release! |
@messense Great news! I'll change the latest Maturin to build. |
I'm still having
|
I moved this topic to #418 |
Now Pyxel Web works stably. So please let me close this issue. Thank you. |
Thanks to everyone's great efforts, now Pyxel works on web browsers.
Here is the test site of web features: https://kitao.github.io/pyxel/wasm/
It's working, but there are various limitations and points that could be improved.
Therefore, please provide information that will lead to improvement.
Especially I would like to improve following points with priority:
Regardless of these issues, please feel free to discuss various web-related matters with me!
The text was updated successfully, but these errors were encountered: