Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sprite sheet vs flip book

jmartAug 13 2012 — edited Sep 5 2012
hello,

In my project I animate objects by flipping through ImageView's inside a Parent. Basically I have png's of a walking unit at each frame. The png's get loaded at init and stored as Image objects. I even tried flipping through Image objects (instead of the ImageView), and did not notice any diff in performance.

On a java game site I noticed a post touting sprite sheets over flip booking. In JFX do you suspect it is better to use a sprite sheet, where the viewPort is changed to animate an ImageView, versus what I'm doing?

In my limited understanding of what goes on behind the scenes I imagine that this might not have any difference at all as there is still all these images (or one great big image) still in memory. And that JFX would still render the scene the same way. I guess what it might come down to is the difference in amount of processing needed to edit a viewPort versus swapping an Image (inside an ImageView) or an ImageView (inside a parent).

I figure let me ask first, in case there is a general consensus, before going through the work of testing it out. And even if I test it out I might not notice a diff but Joe Schmoe on 6 year old hardware might. Any insight would be appreciated.

thanks
jose
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2012
Added on Aug 13 2012
3 comments
497 views