Class TiledPlatformComponent

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

public class TiledPlatformComponent extends RenderComponent
A render component for dynamically tiling a platform texture based on the entity's size. It handles edge tiles, repeating middle tiles, and stretching for a perfect fit.
  • Constructor Details

    • TiledPlatformComponent

      public TiledPlatformComponent(com.badlogic.gdx.graphics.g2d.TextureRegion leftEdge, com.badlogic.gdx.graphics.g2d.TextureRegion middleTile, com.badlogic.gdx.graphics.g2d.TextureRegion rightEdge)
      Creates a new TiledPlatformComponent.
      Parameters:
      leftEdge - The texture for the left edge.
      middleTile - The middle region texture.
      rightEdge - The texture for the right edge.
  • Method Details

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