electronstudio / jaylib

Java JNI bindings for Raylib
Other
126 stars 23 forks source link

raygui import doesn't work #42

Closed akashKarmakar02 closed 7 months ago

akashKarmakar02 commented 9 months ago

it shows in read me that it includes raygui but i can't import Label, Button how to do it

electronstudio commented 9 months ago
import static com.raylib.Jaylib.*;

public class Raygui {
    public static void main(String[] args) {
        int screenWidth = 800;
        int screenHeight = 600;
        InitWindow(screenWidth, screenHeight, "raygui");
        while (!WindowShouldClose()) {
            BeginDrawing();
            ClearBackground(RAYWHITE);
            GuiLabel(new Rectangle(120, 120, 100, 32), "Hello world");
            if (GuiButton(new Rectangle(10, 10, 100, 32), "TEST")) {
                System.out.println("pressed");
            }
            EndDrawing();
        }
        CloseWindow();
    }
}
akashKarmakar02 commented 9 months ago

Thank you for the help

But I will suggest you too make a different package under com.raylib.raygui the same way it has com.raylib.Jaylib

electronstudio commented 9 months ago

C doesn’t have namespaces so I can’t see any easy way to do it in an automatically generated binding.