A handmade version of Raygui for Raylib-J.
Raygui-J is a handwritten binding of Raygui v3.2 in Java for use with the Raylib-J framework.
That being said, Raygui-J operates diferently than its C original.
Label | Button | LabelButton | Toggle | ToggleGroup | CheckBox
ComboBox | DropdownBox | TextBox | TextBoxMulti | ValueBox | Spinner
Slider | SliderBar | ProgressBar | StatusBar | DummyRec | Grid
WindowBox | GroupBox | Line | Panel | ScrollPanel
ListView | ColorPicker | MessageBox | TextInputBox
Raygui-J organises these basic controls into objects that are then passed to the appropreate Gui*
function where object values are updated based on user interaction.
Only the default style is currently supported.
Only the default icons are currently supported.
The following code is an example of how to retrieve user text from a TextBox.
package tests;
import com.raylib.java.Raylib;
import com.raylib.java.core.Color;
import com.raylib.java.gui.Raygui;
import com.raylib.java.gui.elements.TextBox;
public class text {
static Raylib rlj;
static Raygui rgui;
static TextBox textBox;
static String userText;
public static void main(String[] args) {
rlj = new Raylib(800, 600, "rGUI-J - Textbox");
rgui = new Raygui(rlj);
rgui.GuiEnable();
rlj.core.SetTargetFPS(60);
textBox = new TextBox(20,20,100,30, "text",true, 16);
while (!rlj.core.WindowShouldClose()) {
Update();
Render();
}
rgui.GuiDisable();
}
private static void Update() {
userText = textBox.text;
}
private static void Render() {
rlj.core.BeginDrawing();
rlj.core.ClearBackground(Color.WHITE);
rgui.GuiTextBox(textBox);
rlj.core.EndDrawing();
}
}
I'm fully aware how antiquated this library is in comparison to the original Raygui. On the Raylib-J Roadmap under the heading "0.5.2" I have intentions to update Raylib-J to align with the recent Raylib release. I do plan on updating Raygui-J at that time as well, so please stay tuned.