java.lang.Object
dev.aurumbyte.sypherengine.components.Component
dev.aurumbyte.sypherengine.components.Animator2D
A sprite animation class, using individual images as frames rather than a tileset, is experimental
- Since:
- v0.4.0
- Author:
- AurumByte
- See Also:
-
Field Summary
Modifier and TypeFieldDescription(package private) int
The speed of animation to be played(package private) List<javafx.scene.image.Image>
The frames to be animated uponFields inherited from class dev.aurumbyte.sypherengine.components.Component
componentTag
-
Constructor Summary
ConstructorDescriptionAnimator2D
(List<javafx.scene.image.Image> frames) Create an animator with specified framesAnimator2D
(javafx.scene.image.Image[] frames) Create an animator with specified frames -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFrame
(javafx.scene.image.Image frame) Adding a frame to the animationvoid
addFrames
(javafx.scene.image.Image[] frames) Adding multiple frames to the animationint
Getting how many frames are present in the animationList<javafx.scene.image.Image>
Getting the frames present in the animationvoid
removeFrame
(javafx.scene.image.Image frame) Removing a frame from the animationvoid
removeFrames
(javafx.scene.image.Image[] frames) Removing multiple frames from the animationvoid
render
(SypherEngine engine) Rendering the framesvoid
Setting the frames present in the animationvoid
setFrames
(javafx.scene.image.Image[] frames) Setting the frames present in the animationvoid
update
(float deltaTime) Updating the AnimationMethods inherited from class dev.aurumbyte.sypherengine.components.Component
getAABBComponent
-
Field Details
-
frames
List<javafx.scene.image.Image> framesThe frames to be animated upon -
animationSpeed
int animationSpeedThe speed of animation to be played
-
-
Constructor Details
-
Animator2D
Create an animator with specified frames -
Animator2D
public Animator2D(javafx.scene.image.Image[] frames) Create an animator with specified frames
-
-
Method Details
-
update
public void update(float deltaTime) Updating the Animation
-
render
Rendering the frames
-
addFrame
public void addFrame(javafx.scene.image.Image frame) Adding a frame to the animation
- Parameters:
frame
- the frame to be added- Since:
- 0.4.0
-
removeFrame
public void removeFrame(javafx.scene.image.Image frame) Removing a frame from the animation
- Parameters:
frame
- the frame to be removed- Since:
- 0.4.0
-
addFrames
public void addFrames(javafx.scene.image.Image[] frames) Adding multiple frames to the animation
- Parameters:
frames
- the frames to be added- Since:
- 0.4.0
-
removeFrames
public void removeFrames(javafx.scene.image.Image[] frames) Removing multiple frames from the animation
- Parameters:
frames
- the frames to be removed- Since:
- 0.4.0
-
getFrameCount
public int getFrameCount()Getting how many frames are present in the animation
- Since:
- 0.4.0
-
getFrames
Getting the frames present in the animation
- Since:
- 0.4.0
-
setFrames
Setting the frames present in the animation
- Since:
- 0.4.0
-
setFrames
public void setFrames(javafx.scene.image.Image[] frames) Setting the frames present in the animation
- Since:
- 0.4.0
-