All Projects → overdev → raylib-py

overdev / raylib-py

Licence: Unknown, Unknown licenses found Licenses found Unknown LICENSE.md Unknown LICENSE.txt
A Python binding for the great C library raylib.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to raylib-py

godot experiments
Some 2D, 3D & VR experiments and tutorials in Godot 3
Stars: ✭ 181 (+23.13%)
Mutual labels:  vr, 2d
TerraCraft
Voxel Engine written in Python 3 + Pyglet.
Stars: ✭ 49 (-66.67%)
Mutual labels:  pygame, pyglet
lifish
A game inspired by Factor Software's "BOOM". Also the repo for BOOM Remake.
Stars: ✭ 38 (-74.15%)
Mutual labels:  arcade, 2d
UnityGameTemplate
Template with all necessary stuff taken care, just create your games main features.
Stars: ✭ 221 (+50.34%)
Mutual labels:  vr, 2d
COVID-Resource-Allocation-Simulator
Agent-based modelling for resource allocation in viral crises to investigate resource allocation and policy interventions with respect to transmission rate.
Stars: ✭ 61 (-58.5%)
Mutual labels:  pygame
vr-streaming-overlay
SteamVR overlay for streamers on Linux/Windows
Stars: ✭ 29 (-80.27%)
Mutual labels:  vr
HadesVR
The "DIY" SteamVR compatible VR setup made for tinkerers.
Stars: ✭ 88 (-40.14%)
Mutual labels:  vr
binocle-unity
Binocle is a simple 2D code-based framework for Unity
Stars: ✭ 23 (-84.35%)
Mutual labels:  2d
LifeBrush
A toolkit for painting agent-based mesoscale molecular simulations and illustrations.
Stars: ✭ 38 (-74.15%)
Mutual labels:  vr
TransformUtils.jl
Lie groups and algebra with some quaternions
Stars: ✭ 18 (-87.76%)
Mutual labels:  2d
SNKRX
A replayable arcade shooter where you control a snake of heroes.
Stars: ✭ 1,067 (+625.85%)
Mutual labels:  2d
BeatSaberSongBrowser
BeatSaber plugin, adds much needed functionality to the song selection interface.
Stars: ✭ 166 (+12.93%)
Mutual labels:  vr
PlaneWars
微信飞机大战 python pygame
Stars: ✭ 22 (-85.03%)
Mutual labels:  pygame
sdf-2d
A graphics library to enable the real-time rendering of 2D signed distance fields on the web.
Stars: ✭ 70 (-52.38%)
Mutual labels:  2d
vrs
WebGL + React + VR experiment. Demo:
Stars: ✭ 21 (-85.71%)
Mutual labels:  vr
hobo vr
SteamVR driver prototyping tool
Stars: ✭ 44 (-70.07%)
Mutual labels:  vr
VRTK-PUN-NetworkTest
A small test project showing how to sync VR CameraRig objects using Photon's PUN and VRTK.
Stars: ✭ 30 (-79.59%)
Mutual labels:  vr
Sight
A spatial search μlibrary powered by GameplayKit 👾
Stars: ✭ 27 (-81.63%)
Mutual labels:  2d
CutAndDisplace
Boundary Element MATLAB code. Modelling faults and deformation
Stars: ✭ 40 (-72.79%)
Mutual labels:  2d
AnotherBadBeatSaberClone
This is a discontinued but perhaps helpful VR project created during my Master's degree at FH Wedel.
Stars: ✭ 22 (-85.03%)
Mutual labels:  vr

raylib-py

PyPI - Python Version GitHub release (latest by date) GitHub Release Date

PyPI - Wheel PyPI - License PyPI - Downloads

GitHub all releases GitHub release (by tag) GitHub forks

GitHub commit activity GitHub commits since tagged version

A python binding for the great C library raylib.

WARNING: This project is in a semi discontinued state.

Plase, read this issue for more information.

I intend to use this repository only to make new package distribution releases. No specific changes in the source will be made.

Release Information:

The current release was made as output of another project, as mentioned in #45.

Features:

  • PEP8 naming convention only:

    Structure attributes are in snake_case, classes and other types in PascalCase.

  • Type hinting (not type annotation):

    def get_ray_collision_mesh(ray, mesh, transform):
        # type: (Ray, Mesh, Matrix) -> RayCollision
  • structures with functions as methods and properties:

    sound = Sound.load('my/resorces/sound.wav')     # same as load_sound(...)
    position = Vector(4.0, 10.0)
    
    # later...
    sound.play()                                    # same as play_sound(sound)
    length = position.length                        # same as vector2length(position); uses raymath.h functions
  • Vector{2,3,4}, Rectangle and Color have attribute swizzling;

    vec3 = Vector3(2.0, 5.0, 3.0)
    vec2 = vec3.zxy                 # vec2 is a Vector2, not a sequence type
    other_vec3 = vec2.xxy           # same thing: other_vec3 is a Vector3
    vec2.xy = vec3.y, other_vec3.z  # sequences can be set as values
    
    c_red = Color(255, 0, 0)
    c_yellow = c_red.rrb
    
    # Rectangles have aliases for width and height: w and h respectively:
    rect = Rectangle(10.0, 10.0, 320.0, 240.0)
    other_rect = rect.whxy          # swizzling is only allowed when using four attributes, not 3 nor 2
  • Pretty printing: most structures implement __str__() and __repr__() in a friendly way;

  • Context managers: begin_* and end_* functions can be called as context managers:

    Without context managers:

    # this example shows a rendering step
    
    begin_drawing()
    
    begin_texture_mode(minimap_texture)
    # render the "minimap"
    draw_line(2, 2, 5, 5, RED)
    end_texture_mode(minimap_texture)
    
    begin_mode2d(main_camera)
    # 2d drawing logic...
    draw_texture(minimap_texture, 10, 10, WHITE)
    end_mode2d()
    
    end_drawing()

    With context managers:

    # this example shows a rendering step
    
    with drawing():
    
        with texture_mode(minimap_texture):
            # render the minimap
            draw_line(2, 2, 5, 5, RED)
    
        with mode2d(main_camera):
            # 2d drawing logic...
            draw_texture(minimap_texture, 10, 10, WHITE)
  • Context managers for some structures: Camera{2,3}D, Shader and others;

    Folowing the example above:

    # this example shows a rendering step
    
    with drawing():
    
        with minimap_texture:
            # render the minimap
            draw_line(2, 2, 5, 5, RED)
    
        with main_camera:
            # 2d drawing logic...
            draw_texture(minimap_texture, 10, 10, WHITE)
  • RLGL and RayMath functions exposed

    Includes all symbols in raymath.h and rlgl.h

Issues:

  • Callback for logging will not work

    I've no good workaround for wrapping C functions with variable number of arguments. If you know how to solve this issue, your help would be appreciated.

  • Functions with vararg will not work

    For the reason above.

  • Avoid string manipulation functions

    For the reason above, also because some functions involve memory allocation and manual freeing of resources. Python string methods can provide you with same and more functionality.

  • Some examples are broken due to API changes

    There was some function renaming, some changes in the examples to update to newer releases.

Would you like to have a more customized binding for raylib?

Again, in issue 45 I explain the actual state of this project in more detail.

It my seems like bad news but actually it is the contrary.

Please, take a look at this project: raylibpyctbg

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].