Package ecs

Class SpriteAnimation

java.lang.Object
ecs.Component
ecs.SpriteAnimation
All Implemented Interfaces:
Comparable<Component>

public class SpriteAnimation extends Component

Azurite

Since:
26.07.2021
Author:
Juyas
  • Constructor Details

    • SpriteAnimation

      public SpriteAnimation(SpriteRenderer renderer, Sprite baseImage, float timePerSprite)
  • Method Details

    • setAnimation

      public void setAnimation(String name, List<Sprite> sprites)
    • setBaseImage

      public void setBaseImage(Sprite baseImage)
    • setCurrentRepetition

      public void setCurrentRepetition(int currentRepetition)
    • setTimePerSprite

      public void setTimePerSprite(float timePerSprite)
    • nextAnimation

      public void nextAnimation(String nextAnimation, int nextRepetitions)
    • switchAnimation

      public void switchAnimation(boolean instant)
    • setAnimationEndEvent

      public void setAnimationEndEvent(Consumer<String> animationEndEvent)
    • start

      public void start()
      Description copied from class: Component
      Called once on Component initialization.
      Overrides:
      start in class Component
    • update

      public void update(float dt)
      Description copied from class: Component
      Called once per frame for each Component
      Overrides:
      update in class Component
      Parameters:
      dt - Engine.deltaTime