Class AnimationEffectsComponent

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

public class AnimationEffectsComponent extends AnimationRenderComponent
A component responsible for rendering animation effects using a TextureAtlas.
  • Constructor Details

    • AnimationEffectsComponent

      public AnimationEffectsComponent(com.badlogic.gdx.graphics.g2d.TextureAtlas atlas)
      Initializes the AnimationEffectsComponent with the given TextureAtlas.
      Parameters:
      atlas - The TextureAtlas containing animation frames.
  • Method Details

    • setOffset

      public void setOffset(com.badlogic.gdx.math.Vector2 offset)
      Sets the offset for adjusting the position of the rendered animation.
      Parameters:
      offset - The Vector2 representing the offset in (x, y) coordinates.
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draws the current frame of the animation using the provided SpriteBatch.
      Overrides:
      draw in class AnimationRenderComponent
      Parameters:
      batch - The SpriteBatch used for rendering.
    • getScale

      public com.badlogic.gdx.math.Vector2 getScale()
      Gets the scale used for rendering the animation.
      Returns:
      A copy of the Vector2 representing the scale.
    • setScale

      public void setScale(com.badlogic.gdx.math.Vector2 scale)
      Sets the scale for adjusting the size of the rendered animation.
      Parameters:
      scale - The Vector2 representing the scale in (x, y) dimensions.