Class SpriteAnimationFactory


  • @Service
    public class SpriteAnimationFactory
    extends java.lang.Object
    Factory for supplying sprite animation of a given image.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2014 Created on Nov 05, 2014
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SpriteAnimation createAnimation​(javafx.scene.image.ImageView imgView, java.lang.String imgName, boolean resetAtEnd)
      Create an animation for the sprite on the image view.
      javafx.scene.image.ImageView createImageViewForSprite​(java.lang.String imgName)
      Create an image view containing the referenced image and set the viewport to the first image
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpriteAnimationFactory

        public SpriteAnimationFactory()
    • Method Detail

      • createAnimation

        public SpriteAnimation createAnimation​(javafx.scene.image.ImageView imgView,
                                               java.lang.String imgName,
                                               boolean resetAtEnd)
        Create an animation for the sprite on the image view.
        Parameters:
        imgView - on which the animation happens
        imgName - referenced image name
        resetAtEnd - flag indicating if at the end ef the animation the initial state should be restored.
        Returns:
        sprite animation.
      • createImageViewForSprite

        public javafx.scene.image.ImageView createImageViewForSprite​(java.lang.String imgName)
        Create an image view containing the referenced image and set the viewport to the first image
        Parameters:
        imgName - name of the sprite
        Returns:
        ImageView