Wednesday, 7 January 2009

Moon Monsters in JavaFX

The Moon Monsters demo shows up as the first sample in Microsoft's Silverlight 1.0 Gallery. I thought it'd be great to test-drive JavaFX by porting this demo from Silverlight to JavaFX 1.0.

This seemingly simple demo actually touches on quite a few areas in the core stength of the JavaFX APIs - 2D graphics, data binding and input events handling. While the JavaFX port of the Moon Monsters is a pretty faithful implementation of the original features, it is not 100% complete. The following are not implemented here:

  1. The graphics for paintbrush and keyboard are not included because it is too laborious to copy the coordinates into the JavaFX script.
  2. The HTML Overlay feature is not implemented. I don't know how to do this in JavaFX because unlike Silverlight 1.0, JavaFX is not Javascript based and it is not bound to HTML either. If anyone knows how to do this in JavaFX, please leave a comment.
The source files are available here:

Related Posts: