/Raylib-J

Handmade Java binding for Raylib

Primary LanguageJavazlib LicenseZlib

Raylib-J

A handmade version of Raylib for Java.

Raylib-J is still in development.


About

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 being built based on the 4.0 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!


Basic Example

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!


Using Raylib-J

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!


Development Status:

[X] rCore
[X] rShapes
[X] rTextures
[X] rText
[o] rModels
[ ] rAudio
[X] RLGL
[X] Raymath
[X] Physac
[ ] raygui+ricons
[X] easings
[p] rGestures - Will look into reimplementing later on (08/03/21)
[X] rLights

Key: X - complete | O - nearing completion | o - in progress | p - postponed