@Empire Phoenix said:
I would suggest to make it an interface, and allow users to push via guimanager their own custom logic.
-> special thinking here is required as for usefull checks they would need access to jfx, but events are in jme thread.
Yeah but I’m mostly thinking about it for my own sake. What is the best custom logic to use?
Btw Empire Phoenix, I like how your avatar looks terrified or sleep-deprived (is that what you look like after year of working on your game?) while mine looks like a troll face.
Hm the best approach for all cases (and yours)
would be
To query the jfx components actually for the position, and check using their mousetransparent & disabled property if there is something that wants input.
Problem is that I don’t think you can query jfx components from jme3 thread - but you need to know if event should be consumed or not immediately in jme3 thread. Otherwise, you will introduce few frames of input lag (jfx is running at 30fps internally I think, so we are talking about 30-50ms latency).
Hm what might be possible, to generate/update actually a kinda like boolean bitmap in the jfx thread, and use it to fast query from jme thread.
Question is how fast it could be generated.
INFO: Audio effect extension version: 1.0
Nov 27, 2014 6:33:13 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread
INFO: Audio max auxilary sends: 4
Nov 27, 2014 6:33:34 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalArgumentException: Number of remaining buffer elements is 6627840, must be at least 14745600. Because at most 14745600 elements can be returned, a buffer with at least 14745600 elements is required, regardless of actual returned element count
at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:162)
at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:189)
at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:230)
at org.lwjgl.opengl.GL11.glTexImage2D(GL11.java:2845)
at com.jme3.renderer.lwjgl.TextureUtil.uploadTexture(TextureUtil.java:352)
at com.jme3.renderer.lwjgl.LwjglRenderer.updateTexImageData(LwjglRenderer.java:1913)
at com.jme3.renderer.lwjgl.LwjglRenderer.setTexture(LwjglRenderer.java:1936)
at com.jme3.material.MatParamTexture.apply(MatParamTexture.java:86)
at com.jme3.material.Material.render(Material.java:1088)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:523)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:322)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:374)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:763)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:719)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:983)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:745)
The video playback is very critical to this 3D application I’m working on. I’m unable to make sense of these errors as I’m a n00b when it comes to graphics development. Any and all help will be appreciated mateys!
Opened an issue. Thanks for the help buddy. If it means anything I really wanna stick with Java and JME3. It is beautiful, easy and productive enough for me to have already finished most of the 3D aspects of my work. The video is the content part of it and I really don’t wanna consider alternatives just for video playback issues. Also, found a pretty old link about WebM support in JavaFX, not sure if it is still relevant today and won’t be surprised if Oracle ignores open formats but with JavaFX beginning to be open sourced, maybe we’ll get to see WebM playback in JME3 someday?
I finally got some time to implement a very nice feature that is only possible thanks to the underlying jfx.
Basically you can now externalize every AbstractWindow based ui.
Uses:
Multimonitor useage
Chatlog
GameConsole
SpaceShipcomputer IDE
How it works:
-> setExternalizable(true)
adds a new button to the WindowIcons that allow externalizing and internalizing.
-> setExternalized(boolean)
directly externalzied a window. does also work for non visible ones, upon attaching they will be directly external then.
Current Issues
-> Styling for the external window is hardcoded currently
If anyone has ideas how to do a unified styling for internal and external windows, so they look alike but are css adjustable suggestions would be nice
-> External window is not resizable currently, i guess all current operation systems use resizing on border drag, I will try to implement this over the holidays.
It is probably a bit rough on the edges currently, but feedback would be appreciated.
Hi people, I’m back. Post video playback (intro video), I tried to do a rootNode.detachAllChildren() and attach a new Spatial, I got to stare at a blank screen. Minus the video playback am able to attach the Spatial just fine. There are no abnormal error messages or exceptions raised. Am I missing anything super simple?
Thanks for the sample, but a standalone sample packaged archive (zip, tar.gz) would be better. No need to change the code, and to provide place-holder for missing asset (j3o, video,…).
I never used nifty (the only one GUI for jME, I never tried ). IMHO, It’s strange to combine nifty and javafx.
I’ll give a try asap (my coding desktop crash this morning, no ETA).
A quick remark :
new Media(new File(this.getClass().getResource(videoPath).getFile()).toURI().toASCIIString());
should be replaced by (resource could be inside a jar,…) :
new Media(this.getClass().getResource(videoPath).toExternalForm());
Well, I’m a beginner to all of this Is it possible to make the UI entirely outta JFX? I changed the code as suggested. Shall, provide a tar.gz bundle asap. Thanks mate!!
Yes you can do the HUD (UI) in javafx. I use SceneBuilder 2 (visual editor to create fxml) + css.
you can take a look at samples into jme3-jfx, or 2 of my projects :
I doubt it is a real problem in this case, but for future - you need to dispatch code inside setOnEndOfMedia to jme thread, instead of modifying jme3 viewport from undefined jfx thread.