electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
142 stars 29 forks source link

Add Fog Shader Example #6

Closed Pebaz closed 4 years ago

Pebaz commented 4 years ago

Fog example translated to Python!

Also created an example where you can drag around a transparent undecorated window with animation!

electronstudio commented 4 years ago

cool fog effect

electronstudio commented 4 years ago

i probably should have tested the transparent undecorated example before merging! it gives me

Traceback (most recent call last):
  File "C:/Users/richard/Documents/raylib-python-cffi/examples/transparent_undecorated_window.py", line 26, in <module>
    offset = Vec2(rl.GetMousePosition())
  File "C:/Users/richard/Documents/raylib-python-cffi/examples/transparent_undecorated_window.py", line 21, in <lambda>
    Vec2 = lambda p: glm.vec2(p.x, p.y)
AttributeError: module 'glm' has no attribute 'vec2
Pebaz commented 4 years ago

Oh no! I believe there may be some sort of library versioning mixup. GLM does in fact have the function vec2 so maybe there is another library named GLM in your site-packages?

The one this example needs is https://github.com/Zuzu-Typ/PyGLM

electronstudio commented 4 years ago

Yes it said it needed module 'glm' so I installed 'glm'. Quite ridiculous that python doesnt use fully qualified names and allows two packages to share the same namespace! Anyway I now have pyglm but I get this error:

screeninfo/screeninfo.py", line 29, in get_monitors
    raise ScreenInfoError("No enumerators available")
screeninfo.common.ScreenInfoError: No enumerators available

I guess might be because I'm on MacOS.

Pebaz commented 4 years ago

That's unfortunate. The author of the screeninfo library said that OSX is a supported environment but he has no plans to test on that platform. :| I used that library specifically for cross-platform monitor size querying so I'm disappointed that it doesn't work on that platform. I guess the next course of action is just to roll back the commit containing the transparent_undecorated_window.py file. Sorry for the hassle, I would fix it for MacOS but I don't have one available to me to use.

electronstudio commented 4 years ago

It works, just need to install two more packages: pyobjus and Cython