i just want to know what are the advantajes of a game created with javaFX?, because i think LWJGL or LIBGDX are better and can be ported to other platforms ( in the case of libGDX).
I could think of a few reasons.
- No natives or external jars to repack
- Since Java is a “write once, read anywhere” language, it’s already portable
- You can get loads of information literally anywhere on the internet
Just pay attention that there are disadvantages as well - JavaFX is still not supported in OpenJDK, performance will be lower than in case of OpenGL-based libraries (but this shouldn’t be a big problem unless you want to make 3d game or 2d one with a lot of effects).
I’m intrigued by the positives, and am not well acquainted yet with the limitations of JavaFX.
JavaFX has support for 3D and both it and the capabilities for 2D drawing are well integrated with the use of standard controls (text fields, sliders, etc.). I think trying to use Swing Controls with Libgdx or LWJGL is a bit of a nightmare. Someone please correct me if I am wrong.
I’m finding the graphics tools for special effects are quite nice, and easier to use than the parallel system Java2D.
JavaFX also plays well with CSS, and XML via FXML, reminding me of a lot of the benefits of the way Android deals with resources.
There are growing indications of expanded cross-platform support, now that JavaFX is the “go to” graphics system rather than Swing. RoboVM for example claims to be working on JavaFX support, though I don’t know how that effort is progressing.
JavaFX has had a lot of high-level thought and considerable expertise go into developing its syntax. I find it much easier to hold in my brain, as a result, than libgdx. Working with it feels like using I still writing Java code, rather than having to learn a whole new paradigm or language. Others who have made the leap to libgdx and have younger and more flexible brains than me will probably object to this comparison.
Probably, it is still lagging a bit in performance, and in the number of platforms supported. But I’m keeping an eye on it as there is new energy being put into improving it. I haven’t seen much in the way of performance comparisons yet, but I haven’t looked for them either. They are probably out there.
I thought JavaFX was dead. In fact I’m not entirely convinced it isn’t.
It’s in OpenJFX, which will finally be included in the next LTS of Ubuntu, so I may actually start playing with it then. :
No idea on performance, but isn’t JavaFX OpenGL-based too?
Hardly! I think it’s going to be part of the JavaSE spec from Java 9.
Performance, as ever in Java, is a mixed bag and depends exactly what you’re trying to do and how much of it. For 2D spritey stuff though it’s very acceptable if you stay away from vector graphics which are still all done on the CPU. Plus the added bonus that finally doing in-game UIs is easy
It runs under DX on Windows and OpenGL elsewhere, though right now, I’m running it on OpenGL on Windows too thanks to a small amount of hackery. Not that it makes any difference to performance, I was just curious to see it working.
It still has a few small niggles and the API is very incomplete at this stage - simple stuff like easily finding which rows are visible in a list view for example is really vexing, and all sorts of handy utilities. I love the CSS styling - even a developer like me can now make fancy looking UIs easily! - and the Scene Builder app is actually very good.
Cas
There is one backend based on ES 2 but it isn’t bundled in the JRE by default under Windows… JavaFX 3D API has the same design flaws than Java3D < 1.6, it has a few features, better use JMonkeyEngine, LibGDX or JogAmp’s Ardor3D Continuation instead of it. Its software fallback is really slow. Personally, I’ll use OpenJFX/JavaFX when Java 1.9 is out but I prefer using Swing for GUIs and other APIs for my games.
Unlicense has an excellent set of widgets too:
http://unlicense.developpez.com/gallery/2D_widgets_l.png
http://unlicense.developpez.com/gallery/2D_explorer_l.png
http://unlicense.developpez.com/gallery/2D_widgets_treetable_l.png