Class CutsceneDisplay

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

public class CutsceneDisplay extends UIComponent
Component that can be attached to an entity in order to render necessary visual elements for a cutscene (text boxes, buttons, background). Also handles button presses for progressing cutscene
  • Constructor Details

    • CutsceneDisplay

      public CutsceneDisplay(List<CutsceneReaderComponent.TextBox> textBoxList, GameArea area)
      Initialises the UI for the cutscene
      Parameters:
      textBoxList - An ordered list of all text boxes to show, generated by a CutsceneReaderComponent ideally
      area - The instance of the GameArea the entity this component is attached to is apart of
  • Method Details

    • create

      public void create()
      Generates a stack which is rendered to the UI. The stack has two layers:

      - A background

      - A text box (containing text and button)

      Also attaches an event listener to the button in the text box to progress to next text boss, and load next GameArea when necessary

      Overrides:
      create in class UIComponent
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draw is not used by an instance of this component as the Stack is handled by Scene2D
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • dispose

      public void dispose()
      Correctly removes all widgets registered in the root stack object
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent