Class AnimationRenderWithAudioComponent

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class AnimationRenderWithAudioComponent extends AnimationRenderComponent
  • Constructor Details

    • AnimationRenderWithAudioComponent

      public AnimationRenderWithAudioComponent(com.badlogic.gdx.graphics.g2d.TextureAtlas atlas)
      Create the component for a given texture atlas.
      Parameters:
      atlas - libGDX-supported texture atlas containing desired animations
  • Method Details

    • addSound

      public void addSound(String sound, String animationName, int index)
    • startAnimation

      public void startAnimation(String name)
      Start playback of an animation. The animation must have been added using addAnimation().
      Overrides:
      startAnimation in class AnimationRenderComponent
      Parameters:
      name - Name of the animation to play.
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Description copied from class: RenderComponent
      Draw the renderable. Should be called only by the renderer, not manually.
      Overrides:
      draw in class AnimationRenderComponent
      Parameters:
      batch - Batch to render to.