Class CutsceneTextDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.cutscenes.CutsceneTextDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
CutsceneTextDisplay handles displaying scrolling text during a cutscene. The text is displayed
one character at a time, and pressing ENTER will skip the scrolling and display the full text immediately.
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
ConstructorsConstructorDescriptionCutsceneTextDisplay
(boolean visible) Default constructor that initializes without a specific cutscene.CutsceneTextDisplay
(com.badlogic.gdx.scenes.scene2d.ui.Skin skin) -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Sets up the text display UI, including the background image and text label, and adds it to the stage.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Custom draw method to handle additional rendering.com.badlogic.gdx.scenes.scene2d.ui.Table
getTable()
Returns the main table containing the text display UI components.void
setStage
(com.badlogic.gdx.scenes.scene2d.Stage stage) Sets the stage for this UI component.void
Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.csse3200.game.rendering.Renderable
render
-
Constructor Details
-
CutsceneTextDisplay
public CutsceneTextDisplay(boolean visible) Default constructor that initializes without a specific cutscene. -
CutsceneTextDisplay
public CutsceneTextDisplay(com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
-
-
Method Details
-
create
public void create()Sets up the text display UI, including the background image and text label, and adds it to the stage.- Overrides:
create
in classUIComponent
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Custom draw method to handle additional rendering. Drawing is handled by the stage, so no custom drawing is needed here.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
setText
-
setStage
public void setStage(com.badlogic.gdx.scenes.scene2d.Stage stage) Sets the stage for this UI component.- Parameters:
stage
- The stage to assign.
-
getTable
public com.badlogic.gdx.scenes.scene2d.ui.Table getTable()Returns the main table containing the text display UI components.- Returns:
- The table containing the display components.
-