pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
319 stars 36 forks source link

pygame surfacearray not working #104

Closed tigercoding56 closed 1 year ago

tigercoding56 commented 1 year ago

even though i can import numpy , it seems that pygame cannot initialise / import it ?

1202: want='PIL' found : True
pkg : http://localhost:8000/archives/repo/pkg/PIL-9.1.1-cp311-cp311-wasm32_mvp_emscripten.whl
 |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX| 100.0% 
646: starting shell
996: 31 lines queued for async eval
going interactive
643: TODO detect input/print to select repl debug
181: FIXME dependency table for manually built modules
1202: want='numpy' found : True
pkg : http://localhost:8000/archives/repo/pkg/numpy-1.22.4-cp311-cp311-wasm32_mvp_emscripten.whl
 |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX| 100.0% 
resume=<function <module> at 0x1016f98> is not awaitable
Traceback (most recent call last):
  File "/data/data/org.python/assets/site-packages/pygame/__init__.py", line 50, in _attribute_undefined
    raise RuntimeError(f"{name} is not available")
RuntimeError: pygame.PixelArray is not available
>>> 
FinFetChannel commented 1 year ago

Have you seen this? https://github.com/pygame-web/pygbag/issues/86

basically, you have to import pygame.surfarray too

tigercoding56 commented 1 year ago

Have you seen this? #86

basically, you have to import pygame.surfarray too

thank you , i did not notice, someone ought to update the documentation sometime in the future