Class BackgroundMapComponent

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

public class BackgroundMapComponent extends RenderComponent
Draws a single texture as the world background, positioned at (0,0). Scales to fill the camera viewport height; width is scaled by aspect.
  • Constructor Details

    • BackgroundMapComponent

      public BackgroundMapComponent(com.badlogic.gdx.graphics.Texture texture, float worldHeight)
  • Method Details

    • getWorldWidth

      public float getWorldWidth()
    • getWorldHeight

      public float getWorldHeight()
    • draw

      public 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.
    • getZIndex

      public float getZIndex()
      Description copied from interface: Renderable
      Z index controls rendering order within a layer. Higher Z index is drawn on top.
      Specified by:
      getZIndex in interface Renderable
      Overrides:
      getZIndex in class RenderComponent
      Returns:
      Z index
    • 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