Class EntityAnimation

    • Constructor Summary

      Constructors 
      Constructor Description
      EntityAnimation​(int[] animationsinformation, boolean autostart, boolean loop)
      Create an entity with an animation with an array wich has the time of every animation step in ms in it.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose​()
      removes itself from parent
      void setOffset​(float time)
      set an offset in time.
      void setParent​(AbstractEntity parent)  
      void start​()
      Starts the animation.
      void stop​()
      Stops the animation.
      void update​(float dt)
      updates the entity and the animation.
      • Methods inherited from class java.lang.Object

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

      • EntityAnimation

        public EntityAnimation​(int[] animationsinformation,
                               boolean autostart,
                               boolean loop)
        Create an entity with an animation with an array wich has the time of every animation step in ms in it.
        Parameters:
        animationsinformation - the time in ms for each animation step
        autostart - True when it should automatically start.
        loop - Set to true when it should loop, when false it stops after one time.
    • Method Detail

      • update

        public void update​(float dt)
        updates the entity and the animation.
        Specified by:
        update in interface Component
        Parameters:
        dt - the time wich has passed since last update
      • start

        public void start​()
        Description copied from interface: Animatable
        Starts the animation.
        Specified by:
        start in interface Animatable
      • stop

        public void stop​()
        Description copied from interface: Animatable
        Stops the animation.
        Specified by:
        stop in interface Animatable
      • setOffset

        public void setOffset​(float time)
        set an offset in time.
        Parameters:
        time - in ms
      • dispose

        public void dispose​()
        Description copied from interface: Component
        removes itself from parent
        Specified by:
        dispose in interface Component