A handmade version of Raylib for Java.
Raylib-J is still in development.
Raylib-J is a handwritten binding of Raylib in Java using LWJGL3 to provide the OpenGL framework.
To quote @raysan5:
NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.
Raylib-J is currently up-to-date with the 4.2 release of Raylib
Raylib-J is meant to be a one-for-one rewrite of Raylib with some quality of life changes including, but not limited
to: JavaDoc comments, DrawFPS(int posX, int posY, Color theColorYouWant)
, and CloseWindow()
being handled
automatically!
Here's all the code needed to create a window and render some text:
package example;
import com.raylib.java.Raylib;
import com.raylib.java.core.Color;
public class example{
public static void main(String[] args){
Raylib rlj = new Raylib();
rlj.core.InitWindow(800, 600, "Raylib-J Example");
while (!rlj.core.WindowShouldClose()){
rlj.core.BeginDrawing();
rlj.core.ClearBackground(Color.WHITE);
rlj.text.DrawText("Hello, World!", 800 - (rlj.text.MeasureText("Hello, World!", 20)/2), 300, 20, Color.DARKGRAY);
rlj.core.EndDrawing();
}
}
}
More examples like the one above can be found at the Examples repo, or you can see the wiki for additional documentation and elaboration!
At the current moment Raylib-J is only available as a .jar file. Check the releases page to download the most up-to-date version!
Raylib-J is split between the following modules:
- Core: Contains all basic Raylib functions.
- Models: Load and render models and render 3D Geometry
- Audio: Load, manipulate, and play audio
- RLGL: Raylib's OpenGL abstraction layer.
- Shapes: Need to draw 2D shapes and check collision between them? Look no further.
- Text: Manipulate and render text using the default Raylib font, or import your own!
- Textures: All your texture and image needs.
- Utils: A Raylib-J specific module that contains things like
rLights
,FileIO
, andrEasings
Check the Raylib Cheatsheet to see each module's available methods!
Other people helped with this process! Whether that was opening an issue or making a library that was used in place of the original libraries to make a lot of this project possible, or at least much easier to develop. Special thanks to the following:
- delthas for their JavaMP3 API
- brammie15 for catching an error that made it into production for an embarrassingly long time
- elias94 for helping get this library running on OSX
- mateoox600 for catching a number of issues and helping update the Examples Repo
- Irgendwer01 for converting the project to use the Gradle build system.
- ejenk0 for helping with smoothing out the Gradle build process and assisting with the update process.
- Everyone in the Raylib discord!'
- And you for your time checking out this project!
Want to see what's cooking or where you can help push the library towards the next release? Check the Roadmap!
Otherwise here's the quick list:
[X] rCore
[X] rShapes
[X] rTextures
[X] rText
[X] rModels
[o] rAudio
[X] RLGL
[X] Raymath
[X] Physac
[X] easings
[X] rLights
Key: X - complete | O - nearing completion | o - in progress | p - postponed