Module technology.sola.engine
Class SpriteKeyFrame
java.lang.Object
technology.sola.engine.graphics.components.SpriteKeyFrame
SpriteKeyFrame holds information about how long a particular sprite should be rendered as part of an animation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
This duration value informs theSpriteAnimatorSystem
to not tick the duration of the sprite, so it will continue to render on this frame. -
Constructor Summary
ConstructorsConstructorDescriptionSpriteKeyFrame
(String spriteSheetId, String spriteId) Creates a new sprite key frame from desiredSpriteSheet
id and sprite id.SpriteKeyFrame
(String spriteSheetId, String spriteId, long duration) Creates a new sprite key frame from desiredSpriteSheet
id, sprite id, and duration.SpriteKeyFrame
(SolaImage spriteImage) Creates a new sprite key frame from desiredSolaImage
.SpriteKeyFrame
(SolaImage spriteImage, long duration) Creates a new sprite key frame from desiredSolaImage
and duration. -
Method Summary
-
Field Details
-
DURATION_FREEZE
public static final long DURATION_FREEZEThis duration value informs theSpriteAnimatorSystem
to not tick the duration of the sprite, so it will continue to render on this frame.- See Also:
-
-
Constructor Details
-
SpriteKeyFrame
Creates a new sprite key frame from desiredSpriteSheet
id and sprite id. Defaults the duration toDURATION_FREEZE
.- Parameters:
spriteSheetId
- the SpriteSheet asset idspriteId
- the sprite id
-
SpriteKeyFrame
Creates a new sprite key frame from desiredSpriteSheet
id, sprite id, and duration.- Parameters:
spriteSheetId
- the SpriteSheet asset idspriteId
- the sprite idduration
- the duration of rendering for this frame in the animation sequence
-
SpriteKeyFrame
Creates a new sprite key frame from desiredSolaImage
. Defaults the duration toDURATION_FREEZE
.- Parameters:
spriteImage
- the image of the sprite
-
SpriteKeyFrame
Creates a new sprite key frame from desiredSolaImage
and duration.- Parameters:
spriteImage
- the image of the spriteduration
- the duration of rendering for this frame in the animation sequence
-
-
Method Details
-
getSpriteSheetId
- Returns:
- the
SpriteSheet
asset id
-
getSpriteId
- Returns:
- the sprite id in the
SpriteSheet
-
getDuration
public long getDuration()- Returns:
- the duration of this frame in the animation
-