Package: raypyc
raylib-python-ctypesA python wrapper for the greatest graphic libraryraylib.Prerequisitesraypycuses typeannotationsin its source, so a Python version that
supports it is required.Installingthe fastest way to use raypyc is by using the pip install command:pip install raypycorpython -m pip install raypycUsing raypycusing raypyc is really simple, take a look at an example:"""raylib [core] example - Basic Window"""fromraypycimport*# ------------------------------------------------------------------------------------# Program main entry point# ------------------------------------------------------------------------------------defmain():# Initialization# ------------------------------------------------------------------------------------SCREEN_WIDTH=800SCREEN_HEIGHT=450init_window(SCREEN_WIDTH,SCREEN_HEIGHT,b"raylib [core] example - basic window")# TODO: Load resources / Initialize variables at this pointset_target_fps(60)# Set our game to run at 60 frames-per-second# ------------------------------------------------------------------------------------# Main game loopwhilenotwindow_should_close():# Detect window close button or ESC key# Update# ----------------------------------------------------------------------------------# TODO: Update variables / Implement example logic at this point# ----------------------------------------------------------------------------------# Draw# ----------------------------------------------------------------------------------begin_drawing()clear_background(RAYWHITE)draw_text(b"Congrats! You created your first window!",190,200,20,LIGHTGRAY)end_drawing()# ----------------------------------------------------------------------------------# De-Initialization# ----------------------------------------------------------------------------------# TODO: Unload all loaded resources at this pointclose_window()# Close window and OpenGL context# ----------------------------------------------------------------------------------# Execute the main functionif__name__=='__main__':main()raylibvsraypycBelow are the differences in usage betweenraylibandraypyc.EnumsAll Ctypeof enums got translated to Python 'constants'. Enums got translated to
Pythonenums.StructuresIn general, all structures inherit fromctypes.Structureclass. At the moment, all the structures have a setters &
getterContributingfirstly, Contributions of any kind welcome!.secondly, here are some of the things that contributing on will help this wrapper the most:porting examples from c to python(if you can, please follow along with
theconventionswhen porting). (C examples,Python examples)fixing(refactoring) myfileGeneration,
so it will look neater...making the wrapper able to port to more operating systemswrapping morecraylib headerto this library[^2][^2] NOTE: at least for now, all the non-functions wrapper stuff need be implemented in
thefilesGeneration.pyfile, and all the
functions wrapper stuff need be implemented in theraypyc/__
init__.pythanksthanks toraysun5,pyraylibandpyrayfor their good work, I took all the inspiration (and some
code ;) ) from them, so thanks you guys very much.
also a big thanks for the people that helped to test and reviewing the library :)!!!also a special thanks toPeter0x44,Its-Kenta,sol-vin,pmp-pandstucotso.