Package ch.sahits.game.graphic.image
Class SpriteAnimationFactory
- java.lang.Object
-
- ch.sahits.game.graphic.image.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
-
-
Field Summary
Fields Modifier and Type Field Description private SelectiveCachableXMLImageLoader
imageLoader
-
Constructor Summary
Constructors Constructor Description SpriteAnimationFactory()
-
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
-
-
-
Field Detail
-
imageLoader
@Autowired @Qualifier("xmlImageLoader") private SelectiveCachableXMLImageLoader imageLoader
-
-
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 happensimgName
- referenced image nameresetAtEnd
- 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
-
-