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

Couldn't work screenshot (Alt+1, Alt+3) in web app #423

Closed
hadamak opened this issue Oct 9, 2022 · 7 comments
Closed

Couldn't work screenshot (Alt+1, Alt+3) in web app #423

hadamak opened this issue Oct 9, 2022 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@hadamak
Copy link
Contributor

hadamak commented Oct 9, 2022

as is:
Alt + 1 or Alt + 3 cause freeze in web app.

to be:
I want to download screenshot pictures.

environment:
https://kitao.github.io/pyxel/wasm/examples/script_test.html and others.
-Microsoft Edge or Firefox
-Windows11

@kitao kitao added the help wanted Extra attention is needed label Oct 10, 2022
@kitao
Copy link
Owner

kitao commented Oct 10, 2022

In the latest Pyxel, I suppressed crashing error when capture functions are used.

To enabled capture functions on the web like other platforms, the chrono crate of Rust should work on the web and I also need to come up with a way to download save file in Emscripten file system.

@km19809
Copy link
Contributor

km19809 commented Oct 10, 2022

@kitao
chrono version above 0.4.20 should work on emscripten target. chronotope/chrono#568

Doesn't it works?

@kitao
Copy link
Owner

kitao commented Oct 17, 2022

@km19809 It can be compiled. But when I called chrono::Local::now() with Emscripten, it crushed.

@kitao
Copy link
Owner

kitao commented Oct 18, 2022

I tried chrono::Local::Now() at the beginning of Pyxel code for test.
The error message was
pyo3_runtime.PanicException: cannot call wasm-bindgen imported functions on non-wasm targets

@km19809
Copy link
Contributor

km19809 commented Oct 19, 2022

It's weird because chrono::Local::now() should target this function.
So wasm-bindgen is not needed.
I first assumed that wasmbind feature of chrono is the problem.
However, even after I modified chrono attribute of cargo.toml, it crashed. (Uncaught 16664952)

[dependencies]
array-macro = "2.1"
chrono = {version = "0.4.22", default-features = false, features = ["clock", "std"]} # `wasmbind` is one of default-features.
# ...

I don't understand why.

@kitao
Copy link
Owner

kitao commented Oct 23, 2022

In the latest version of Pyxel on the web, you can save the output file.

@hadamak
Copy link
Contributor Author

hadamak commented Oct 28, 2022

I became able to do that. Thank you for your nice work.

@hadamak hadamak closed this as completed Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants