-
-

Python Bindings for Raylib 5.0

-

Chatroom: Discord or Matrix

+
+

Python Bindings for Raylib 5.5

+
+

Libraries: raymath, raygui, rlgl, physac and GLFW

+
+
+

Backends: Desktop, SDL, DRM, Web

+

Chatroom: Discord

New CFFI API static bindings.

  • Automatically generated to be as close as possible to @@ -111,21 +124,21 @@

    Python Bindings for Raylib 5.0Full documentation

+

Quickstart

-

pip3 install raylib

-
from pyray import *
-init_window(800, 450, "Hello")
-while not window_should_close():
-    begin_drawing()
-    clear_background(WHITE)
-    draw_text("Hello world", 190, 200, 20, VIOLET)
-    end_drawing()
-close_window()
+

pip3 install raylib==5.0.0.4

+
from pyray import *
+init_window(800, 450, "Hello")
+while not window_should_close():
+    begin_drawing()
+    clear_background(WHITE)
+    draw_text("Hello world", 190, 200, 20, VIOLET)
+    end_drawing()
+close_window()
 
@@ -137,12 +150,40 @@

Installation
python3 -m pip install setuptools
-python3 -m pip install raylib
+python3 -m pip install raylib==5.0.0.4
 

-

On most platforms it should install a binary wheel (Windows 10 x64, MacOS 12 x64/arm64, Linux Ubuntu2004 x64/arm64).

-

If yours isn’t available then pip will attempt to build from source, in which case you will need to have Raylib development libs installed, e.g. +

On most platforms it should install a binary wheel. If yours isn’t available then pip will attempt to build from +source, in which case you will need to have Raylib development libs installed, e.g. using homebrew, apt, etc.

+
+

Windows

+

Binaries require x64 Windows 10 or newer. (For x86 or older Windows you will have to build from source.)

+

Use an official Windows Python release rather than WSL, MSYS, etc.

+
+
+

MacOS

+

Binaries require:

+
    +
  • arm64 MacOS 14

  • +
  • x64 MacOS 10.13, or newer.

  • +
+

Older MacOS requires building from source but this is usually simple:

+
brew install pkg-config
+brew install raylib
+python3 -m pip install raylib==5.0.0.4
+
+
+

(I do have binaries for arm64 MacOS 11, 12 and 13 but I have no way of testing they work, so post an issue +if you want to test them.)

+
+
+

Linux

+

Binaries require OS newer than Ubuntu 2020, x64 or arm64. Otherwise build from source. +(Pip should attempt automatically but will need Raylib itself installed and also pkg-config.)

+

The arm64 binaries are built on Raspberry Pi arm64 Bullseye with OpenGL 2.0 +so may not work on other boards.

+

Raspberry Pi

Using on Rasperry Pi

@@ -150,37 +191,50 @@

Raspberry Pi

Dynamic binding version

There is now a separate dynamic version of this binding:

-
python3 -m pip install raylib_dynamic
+
python3 -m pip uninstall raylib
+python3 -m pip install raylib_dynamic
 

It works on some systems where the static version doesn’t, but be sure to read these caveats before using it

-
-

Beta testing

-

If you find a bug, it may be fixed in the latest dev release. -You can install an alpha or beta version by specifying the exact version number like this:

-
python3 -m pip install raylib==4.2.0.0.dev4
+
+

SDL backend

+

This is not well tested but has better support for controllers:

+
python3 -m pip uninstall raylib
+python3 -m pip install raylib_sdl
+
+
+

You can’t have multiple raylib packages installed at once.

+
+
+

DRM backend

+

This uses the Linux framebuffer for devices that don’t run X11/Wayland:

+
python3 -m pip uninstall raylib
+python3 -m pip install raylib_drm
 
+

You can’t have multiple raylib packages installed at once.

Problems?

If it doesn’t work, try to build manually.. If that works then submit an issue to let us know what you did.

-

If you need help you can try asking on Discord.

+

If you need help you can try asking on our discord. There is also a large Raylib discord +for issues that are not Python-specific.

If it still doesn’t work, submit an issue.

How to use

-

There are two APIs, you can use either or both:

+

There are two modules in the raylib package, raylib and pyray. (There is no separate package for +pyray). You can use either or both:

If you are familiar with C coding and the Raylib C library and you want to use an exact copy of the C API

-

Use the C API.

+

Use the raylib module.

-
-

If you prefer a slightly more Pythonistic API and don’t mind it might be slightly slower

-

Use the Python API.

+
+

If you prefer a more Pythonistic API

+

Use the pyray module.

@@ -239,9 +293,9 @@

Help wanted -

License (updated)

-

The bindings are now under the Eclipse Public License, so you are free to +

+

License

+

Eclipse Public License, so you are free to statically link and use in non-free / proprietary / commercial projects!

diff --git a/docs/RPI.html b/docs/RPI.html index 306cc8a..66de5b9 100644 --- a/docs/RPI.html +++ b/docs/RPI.html @@ -44,7 +44,7 @@