Class ParallaxBackgroundComponent

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

public class ParallaxBackgroundComponent extends RenderComponent
  • Constructor Details

    • ParallaxBackgroundComponent

      public ParallaxBackgroundComponent(com.badlogic.gdx.graphics.Camera camera, float mapWidth, float mapHeight)
  • Method Details

    • addLayer

      public void addLayer(com.badlogic.gdx.graphics.Texture texture, float factor)
    • 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.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • getLayer

      public int getLayer()
      Description copied from interface: Renderable
      Layer to be rendered in. Higher layers will be rendered on top of lower layers.
      Specified by:
      getLayer in interface Renderable
      Overrides:
      getLayer in class RenderComponent
      Returns:
      layer