Class TextureRenderComponent

java.lang.Object
All Implemented Interfaces:
Disposable, Renderable, java.lang.Comparable<Renderable>

public class TextureRenderComponent
extends RenderComponent
Render a static texture.
  • Constructor Details

    • TextureRenderComponent

      public TextureRenderComponent​(java.lang.String texturePath)
      Parameters:
      texturePath - internal path of static teture to render. Will be scaled to the entity's scale.
    • TextureRenderComponent

      public TextureRenderComponent​(Texture texture)
      Parameters:
      texture - Static texture to render. Will be scaled to the entity's scale.
  • Method Details

    • scaleEntity

      public void scaleEntity()
      Scale the entity to a width of 1 and a height matching the texture's ratio
    • draw

      public void draw​(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.