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 TypeMethodDescriptionvoidcreate()Generates a stack which is rendered to the UI.voiddispose()Correctly removes all widgets registered in the root stack objectprotected voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw is not used by an instance of this component as the Stack is handled by Scene2Dvoidupdate()Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndexMethods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render, setLayerMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdateMethods 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
-
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:
createin 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:
drawin classRenderComponent- Parameters:
batch- Batch to render to.
-
update
public void update()Description copied from class:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
dispose
public void dispose()Correctly removes all widgets registered in the root stack object- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classRenderComponent
-