Package com.csse3200.game.ui.cutscene
Class CutsceneReaderComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.ui.cutscene.CutsceneReaderComponent
Component that can be attached to an entity representing a cutscene. Reads a script file for a
cutscene and generates relevant structures for displaying the cutscene.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Record object that represents information about a text box. -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCutsceneReaderComponent
(String scriptPath) Constructs the component with a specified path to the script file it shall read. -
Method Summary
Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
CutsceneReaderComponent
Constructs the component with a specified path to the script file it shall read.- Parameters:
scriptPath
- The path to the script file being read
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
getTextBoxes
Getter method that returns the parsed text boxes from the parsed script file.- Returns:
- A list containing text boxes in the order they were parsed.
-
getBackgrounds
Method that returns a string array containing all background asset paths read.- Returns:
- A string array containing all background assets.
-