Package com.csse3200.game.ui.cutscene
Class CutsceneDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.ui.cutscene.CutsceneDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
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
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
ConstructorsConstructorDescriptionCutsceneDisplay
(List<CutsceneReaderComponent.TextBox> textBoxList, GameArea area) Initialises the UI for the cutscene -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Generates a stack which is rendered to the UI.void
dispose()
Correctly removes all widgets registered in the root stack objectprotected 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 Scene2DMethods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render, setLayer
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
-
CutsceneDisplay
Initialises the UI for the cutscene- Parameters:
textBoxList
- An ordered list of all text boxes to show, generated by a CutsceneReaderComponent ideallyarea
- 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 classUIComponent
-
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 classRenderComponent
- Parameters:
batch
- Batch to render to.
-
dispose
public void dispose()Correctly removes all widgets registered in the root stack object- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-