« Would Like Your Feedback on Offering an Intensive On-Site JavaFX Script Class | Main | One More Canvas Example - JavaFX Clock by Chris Oliver »

November 09, 2007

JavaFX Animation - Some of Sven's Canvas Tricks

Note: This post has been superseded by the Radar Love: JavaFX Animation Examples by Sven post, so please visit that page.

Sven Drieling, whose code examples have been featured previous posts, has some examples on PlanetJFX of animating and interacting with a rectangle.  There are four examples:

  • The first example (RectMove.fx) is very much like the Red Rubber Ball solution in an earlier post, so you'll be in familiar territory at this point.
  • The second example (RectResize.fx) is an example in which you can resize a rectangle by dragging the lower left corner.
  • The third example (RectBounce.fx) animates a rectangle by making it bounce off the sides of a Canvas.  It uses the JavaFX dur operator to control the rate of movement.
  • The fourth example (RectCatch.fx) uses the onMousePressed event to enable the user to "catch" the rectangle as it is bouncing around.

These examples begin to demonstrate, among other things, how you can create animated games in JavaFX Script.  Take a look at the code, and paste them into JavaFXPad.  You might want to run the JavaFX Canvas Tutorial program discussed in this post to refresh yourself on the Canvas/2D related techniques used in Sven's examples.

By the way, I just found out that I'll be presenting in two JavaFX sessions (a university session, and a conference presentation) at JavaPolis 2007 on December 10 - 14, in Antwerp, Belgium.  If you are in attendance, please introduce yourself as I'd like to meet you!

Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54f133d69883400e54f7e6f348833

Listed below are links to weblogs that reference JavaFX Animation - Some of Sven's Canvas Tricks:

Comments

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

My Photo

Upcoming Speaking Engagements:


  • Stephen Chin and Jim Weaver speaking about JavaFX Platform

  • Speaking on JavaFX and Java at Øredev in Malmö, Sweden on 2-6 November, 2009

Upcoming JavaFX Training:


  • Developing Secure, Rich Internet Applications Hosted on a Variety of Clients Using JavaFX Technology

Enter your email address:

Delivered by FeedBurner

Available now as early access eBook


  • Click book image above to obtain eBook

Twitter Updates

    follow me on Twitter

    Affiliations:

    DZone Links:


    July 2009

    Sun Mon Tue Wed Thu Fri Sat
          1 2 3 4
    5 6 7 8 9 10 11
    12 13 14 15 16 17 18
    19 20 21 22 23 24 25
    26 27 28 29 30 31  

    Disclaimer:

    • By reading this site, you are agreeing that under no circumstances will Veriana Networks, Inc. or its affiliates be responsible for (1) any information contained on or omitted from the site, (2) any person's reliance on any such information, whether or not the information is correct, current or complete, (3) the consequences of any action you or any other person takes or fails to take, whether or not based on information provided by or as a result of the use of the sites.