Call Encore now on +44 (0) 1273 722 544 or contact us
Monday 6th, February 2012

Orbitals – a JavaFX Game

Posted by Tony Aldridge on August 24, 2009

I’ve just finished writing a first version of a JavaFX web game called Orbitals.

To play, click, drag, and release the small spaceship to launch.  Use the gravity of the planets to attempt to reach the spinning starbase.

Lost your ship?  Unlikely to get home?  Press the RESTART button and start the level again.

Can’t solve the level?  Press AUTOSOLVE and the computer will show you how it’s done!

Want to try a new configuration of planets?  Hit the GENERATE button and try a new challenge.

Try to beat the par time.  Sometimes it’s easy, other times it’s hard.  Really hard.

Bugs?  Recommendations?  Comments?  Post below and I’ll consider them for the next version.

04/09/09: I just noticed a bug that stops the game working properly in some browsers. Should be fixed now.
04/09/09: I’ve also taken out the signing – the program’s not accessing the local computer or any other site, so it wasn’t needed

Cairngorm-FX

Posted by Jethro Grassie on June 18, 2009

Over the last couple of days I have been busy porting the popular Cairngorm framework into JavaFX and have just uploaded the source into a fresh Google Code project: Cairngorm-FX

http://code.google.com/p/cairngorm-fx/

At Encore we have been very busy with JavaFX and are very excited about the technology. We also happen to use Cairngorm extensively in our Flex based projects as it really helps keep code structured/organized and when working in a team, is a real time saver (aside from coding in a reusable and scaleable way of course).

So a port of Cairngorm to JavaFX was pretty obviously going to be very useful to us! And as it will probably be useful to loads of other developers, we thought we would open-source it (under the MIT License).

Flex skinning tool

Posted by Jethro Grassie on June 7, 2009

Anyone who has done a lot of skinning in Flex will know the simplest, quickest and most effective way is to use a PNG with a scale 9 grid (via the Embed directive).

As an example, applied in CSS:

Button
{
    downSkin: Embed(source="/assets/skin_button_pressed.png",
        scaleGridBottom="23", scaleGridLeft="3", scaleGridRight="11", scaleGridTop="3");
    overSkin: Embed(source="/assets/skin_button_hover.png",
        scaleGridBottom="23", scaleGridLeft="3", scaleGridRight="11", scaleGridTop="3");
    upSkin: Embed(source="/assets/skin_button_normal.png",
        scaleGridBottom="23", scaleGridLeft="3", scaleGridRight="11", scaleGridTop="3");
}

So we get passed a PSD from one of the designers, export the PNG’s, then using an on-screen ruler or the guides in Gimp, work out what the scale grid parameters need to be. And its this last step that is just a bore.

So while toying around with JavaFX 1.2, I knocked together a little application which allows us to simply load a PNG, drag four guides to mark the scale grid, then click a button to copy an Embed tag with correct scale grid values to the system clipboard ready to paste into the code.

I know all of us at Encore will be using this little gem of a time-saver, so for anyone else who fancies using it too, I have packaged it up as a Java Web Start application.

Install and launch here:

Oracle to support JavaFX

Posted by Jethro Grassie on June 4, 2009

From InfoQ:

Many in the community have wondered whether Oracle would maintain the same commitment to JavaFX that Sun has. Oracle rarely offers any insights on product strategy before it completes an acquisition, but in a surprise move Oracle’s chief executive Larry Ellison offered public backing for JavaFX at JavaOne, suggesting that it should be adopted by the OpenOffice group as they work on the UI redesign planned for the next version of the suite.

JavaFX 1.2 Production Suite

Posted by Jethro Grassie on June 3, 2009

And within 24 hours, Sun has released some workflow tooling for JavaFX 1.2.

I really think this rocks too.
It is tackling the workflow for designer and developer in a completely different way to what Adobe is with Flash Catalyst.

Adobe wants designers to:

  1. Design in Photoshop/Illustrator
  2. Load into Flash Catalyst
  3. Tweak, add some behaviours etc
  4. Load into Flash Builder (or use SDK) and code up the rest

To me this seems like adding in another application just to make life harder!
(and I dont really get where Flash IDE is going to fit in with this yet either).

Sun however has it much more straight-forward:

  1. Design in Photoshop/Illustrator (amongst others)
  2. Load into NetBeans (or use SDK) and code it up.

Sun have done a superb job with this suite of plugins.

However, what I find lacking is the ability to create a skin for a built-in control (such as for javafx.scene.control.Button). This will probably come in a future release and is certainly not essential as its fairly straight-forward now to create an entire GUI (or parts thereof) in Photoshop and code up the logic from the exported output.

This workflow also suits our particular company way better than Adobe’s workflow offering and I suspect we are not alone. We have great designers who spend every second of their day in Photoshop or Illustrator, and great programmers who spend their day in a text editor!

I really cant stress how happy we all are here and how much we are looking forward to using this new technology in production. We are writing applications for web, desktop and mobile that JavaFX can really help bridge the gap.

More soon.

Like what you see? Then get in touch;
t. +44 (0) 1273 722 544   e. contact us