Long time programmer with a lot of time on my hands. I like to tinker and make fun little tools/projects.
orange451 / lwjgui Goto Github PK
View Code? Open in Web Editor NEWSimple UI solution for LWJGL3
License: MIT License
Simple UI solution for LWJGL3
License: MIT License
Long time programmer with a lot of time on my hands. I like to tinker and make fun little tools/projects.
I want to create some custom widgets for my project. Where I can find example to that? Or if example not possible please let me know the method. So basically just like any other gui lib we either have a paint method inside component class like qt and swing or we have something like skin classes like javafx. It would be great if you can tell me which classes to look up for understanding how components are exactly made.
Thanks!
When you have a TextField, ComboBox inside s scrollpane. When you scroll the scrollpane to a point the combo box should be off the screen. The drop down, arrow and the text disappear like it should but the box where the text sit doesn't disappear. It just scrolls outside of the scrollpane area. The combo box is still visible
Hi,
It seems that TreeItems are not affected by stylesheets. At least the text doesn't seem to react to the color property.
When using setContent(n)
on a ScrollPane
you cannot retrieve the n
value via getChildren
. The n
value also has its parent marked as null
rather than the ScrollPane
(or its canvas).
This breaks scene-graph searches for items by ID/Type.
Using master-SNAPSHOT
lwjguiWindow = WindowManager.generateWindow(window);
lwjguiWindow.setWindowAutoClear(false);
Label label = new Label();
label.setText("Right pane");
StackPane stackPane = new StackPane();
stackPane.setPrefWidth(100);
stackPane.setFillToParentHeight(true);
stackPane.setBackgroundLegacy(Color.WHITE);
stackPane.getChildren().add(label);
BorderPane borderPane = new BorderPane();
borderPane.setRight(stackPane);
Scene scene = lwjguiWindow.getScene();
scene.setRoot(borderPane);
Not sure if this is intended behavior or not.
When a key is pressed, all the TextField controls receive the KeyPress event regardless of their editing state.
From applications point of view the key press events are relevant to a TextField control only when it is in editing mode. It is trivial to add code to check for isEditing()
but it is extra lines of code, and the behavior here is unexpected and different from JavaFX.
Hi all,
Yesterday I tried import the library in a maven project but i am getting the message shown below
[ERROR] Failed to execute goal on project wglw: Could not resolve dependencies for project org.example:wglw:jar:1.0-SNAPSHOT: Failure to find com.github.orange451:
LWJGUI:jar:Tag in https://jitpack.io was cached in the local repository, resolution will not be reattempted until the update interval of jitpack.io has elapsed or
updates are forced -> [Help 1]
[ERROR]
POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>wglw</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.orange451</groupId>
<artifactId>LWJGUI</artifactId>
<version>Tag</version>
</dependency>
</dependencies>
</project>
I have executed this command from terminal
mvn clean install
The project is empty so i dont know why i can't import the library.
A triple click in any textfield will cause a StringIndexOutOfBoundsException.
It can be reproduced in TextAreaExample. Start the example and do three fast left mouse clicks in any text area - the app will crash.
Exception in thread "Thread-0" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
at java.base/java.lang.String.charAt(String.java:693)
at lwjgui.scene.control.TextInputControl$TextInputScrollPane.lambda$new$2(TextInputControl.java:1126)
at lwjgui.event.EventHelper.fireEvent(EventHelper.java:15)
at lwjgui.scene.Node.onMousePressed(Node.java:1235)
at lwjgui.scene.Window.lambda$mouseButtonCallback$23(Window.java:1089)
at lwjgui.scene.Window$1.call(Window.java:883)
at lwjgui.scene.Window$1.call(Window.java:880)
at lwjgui.Task.callI(Task.java:61)
at lwjgui.scene.Window.render(Window.java:315)
at lwjgui.scene.WindowThread.run(WindowThread.java:66)
This only happens if the text field is empty.
When multiple scene nodes have registered event handlers for key presses they all receive different event objects from the same physical key pressing event. This makes it impossible to use the "consumed" state of the event to signal when the event has been handled.
For example the following will print different addresses for the events and neither of them show the event as "consumed":
var a = new VBox();
a.setOnKeyPressed((event) -> {
System.out.println("a=" + event + ", consumed=" + event.isConsumed());
event.consume();
});
var b = new TextField();
b.setOnKeyPressed((event) -> {
System.out.println("b=" + event + ", consumed=" + event.isConsumed());
event.consume();
});
a.getChildren().add(b);
Output after pressing a key once:
a=lwjgui.event.KeyEvent@25d28510, consumed=false
b=lwjgui.event.KeyEvent@10297de3, consumed=false
The expected behavior is that both show same address for the event and one of them (the latter) shows the event as being "consumed".
Hello! I'm want to use your library - LWJGUI, but I dont found way to added it to my gradle project. However, I can use jitpack and added dependecy by github repo, but I dont know what commit or branch is stable/release.
Can you help me for this?
Thanks in advance!
This may just be a problem with my project setup, but when I try to create a window with the WindowManager class, I get an exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.lwjgl.nanovg.NanoVG.nvgCreateFontMem(JLjava/lang/CharSequence;Ljava/nio/ByteBuffer;I)I
Code:
window = WindowManager.generateWindow(DisplayManager.win); StackPane pane = new StackPane(); window.getScene().setRoot(pane); pane.getChildren().add(new Label("yahoo")); window.show()
Thanks in advance
For BorderPane
the public void calculateNodeBounds()
calculation sets the lower Y coordinate in such a way that all BorderPane
instances in the VBox
have the same starting Y coordinate.
This makes it so that in the class Context
the method Node calculateHoverRecursive(Node parent, Node root)
only ever allows interaction with the last item, because it thinks its bounds cover all the rest.
When switching the VBox
items to a different class such as HBox
the problem does not occur. Seem's like unintentional behavior of the BorderPane
class.
Hi,
While redoing my GUI with your lib I've stumbled into two graphical issues regarding the usage of SplitPane.
First, when I do the following hierarchy: SplitPane <- ScrollPane <- TreeView. (Read "<-" as "contains")
If I set the scroll pane to fill it's parent width and height (which I belive is the correct thing to do when a component must take the whole space it has in a SplitPane) the content of the tree takes the minimal amount of space it can (which is ok since we didn't set it to fill space) but if I set it to fill the space from it's parent I get the following glitch.
And when this happens I can also scoll to the right, making the text disappear even tought the text is smaller than the space inside the divider.
My second issue is when I put a StackPane in the middle of a SplitPane with two divisors, it seems that I can't get it to fill it's space (actually I wanted to put an OpenGL pane but to avoid errors comming from my use of the OpenGLPane I replaced it).
If I set to fill width / height to true I get the following result.
Whereas if I just set it's pref size to a big enought number I get what I want
The code the reproduce this is available here:
https://github.com/ProtectedVariable/ProtectedEngine/pull/19/files
The first issue mentionned is in HierarchyPane.java
The second one in at EditorLayout.java
(On a side note, is there a way to make the divisors of the splitpane thinner ?)
Hope my description is clear enough, feel free to ping me if more infos are needed :)
I have a TextField control that is used as a "console", I'd like to traverse command history when user presses up/down arrow/cursor -keys. However, the events are consumed by the TextField control and never reach my event handler.
This works with JavaFX 14, my current implementation (using JavaFX): https://github.com/Peanhua/plortz/blob/master/src/main/java/plortz/ui/javafx/Console.java
For example, the following code will not print anything when user presses up/down arrow keys when the text field is active:
var tf = new TextField();
tf.setOnKeyPressed((event) -> System.out.println("pressed " + event.getKeyName()));
Rendering on resize does not behave as I expected.
private void loop() {
while (!glfwWindowShouldClose(window) ) {
render();
glfwPollEvents();
}
}
glfwSetWindowSizeCallback(window, (handle, width, height) -> render());
private void render() {
WindowManager.update();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
lwjguiWindow.render();
glfwSwapBuffers(window);
}
Hi all. Can you tell me how i can add image on button?When i add image on button, image dont stay on center button, and when i turn on image, don't event button.
Firstly I would love to thank you for making this. I find this quite resourceful.
I would like to suggest an additional control to the library. A slider. I'm making a 3D game engine, and I need a slider for changing values such as material roughness and light brightness.
I don't know how i can use it. Please, add documentation about how to use this.
When using the tree code from the example it returns the error: Cannot invoke "lwjgui.scene.Node.setPrefSize(double, double)" because "this.graphic" is null
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.