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 TypeMethodDescriptionvoidcreate()Sets up the text display UI, including the background image and text label, and adds it to the stage.voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Custom draw method to handle additional rendering.com.badlogic.gdx.scenes.scene2d.ui.TablegetTable()Returns the main table containing the text display UI components.voidsetStage(com.badlogic.gdx.scenes.scene2d.Stage stage) Sets the stage for this UI component.voidMethods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndexMethods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, renderMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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:
createin 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:
drawin 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.
-