/J8-JME-JFX

JFX Gui bridge for JME with usefull utilities for common usecases for java 8

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

JME3-JFX

JFX Gui bridge for JME with usefull utilities for common usecases

License is the New BSD License (same as JME3) http://opensource.org/licenses/BSD-3-Clause

java compiler options
--add-exports javafx.graphics/com.sun.javafx.embed=ALL-UNNAMED 
--add-exports javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED 
--add-exports javafx.graphics/com.sun.javafx.cursor=ALL-UNNAMED 
--add-exports javafx.graphics/com.sun.glass.ui=ALL-UNNAMED 
--add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED

How to add the library to your project

git clone https://github.com/TalosDx/JME3-JFX.git
./gradlew build
dependencies {
    compile 'com.jme3:jfx:jre8-2.0.0'
}

Maven

work on it

How to integrate jME application to JavaFX ImageView:

    var imageView = new ImageView();
        
    var settings = JmeToJfxIntegrator.prepareSettings(new AppSettings(true), 60);
    var application = new MySomeApplication();
    
    JmeToJfxIntegrator.startAndBindMainViewPort(application, imageView, Thread::new);

How to integrate javaFX UI to jME application:

    public class MyApplication extends SimpleApplication {
    
        private JmeFxContainer container;
        
        @Override
        public void simpleInitApp() {
            container = JmeFxContainer.install(this, getGuiNode());
    
            var button = new Button("BUTTON");
            var rootNode = new Group(button);
            var scene = new Scene(rootNode, 600, 600);
            scene.setFill(Color.TRANSPARENT);

            container.setScene(scene, rootNode);
            
            getInputManager().setCursorVisible(true);
        }
    
        @Override
        public void simpleUpdate(float tpf) {
            super.simpleUpdate(tpf);
            // we decide here that we need to do transferring the last frame from javaFX to jME
            if (container.isNeedWriteToJme()) {
                container.writeToJme();
            }
        }
    }

Also, you can look at some examples in the tests package: