Class TutorialScreenDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.screens.BaseScreenDisplay
com.csse3200.game.components.screens.TutorialScreenDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
UI component that displays the multi-step Tutorial screen.
Each step contains a title, description, and an optional animated clip. Users can navigate with previous/next arrows and return to the main menu.
This component extends BaseScreenDisplay
to reuse common UI helpers
and lifecycle management (stage root, styles, and auto-disposal).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Index of the currently displayed tutorial step.Fields inherited from class com.csse3200.game.components.screens.BaseScreenDisplay
game, logger, neon, root
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
ConstructorsConstructorDescriptionTutorialScreenDisplay
(GdxGame game, List<TutorialStep> steps) Creates a tutorial display bound to a list of steps. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
buildUI
(com.badlogic.gdx.scenes.scene2d.ui.Table root) Builds the initial UI by showing the current step.void
create()
Loads per-screen textures, then delegates toBaseScreenDisplay.create()
to initialise the stage root and build the UI.void
dispose()
Disposes arrow textures and then delegates toBaseScreenDisplay.dispose()
.Methods inherited from class com.csse3200.game.components.screens.BaseScreenDisplay
addBody, addTitle, backMainMenu, button, draw, getZIndex, makeSolidTexture, solidImage
Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, disableComponent, enableComponent, isDisabled, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, 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
-
Field Details
-
currentStep
protected int currentStepIndex of the currently displayed tutorial step.
-
-
Constructor Details
-
TutorialScreenDisplay
Creates a tutorial display bound to a list of steps.- Parameters:
game
- the game instance, used for navigation helperssteps
- ordered list of tutorial steps to render (must not benull
)
-
-
Method Details
-
create
public void create()Loads per-screen textures, then delegates toBaseScreenDisplay.create()
to initialise the stage root and build the UI.- Overrides:
create
in classBaseScreenDisplay
-
buildUI
protected void buildUI(com.badlogic.gdx.scenes.scene2d.ui.Table root) Builds the initial UI by showing the current step.- Specified by:
buildUI
in classBaseScreenDisplay
- Parameters:
root
- the fill-parent root table created byBaseScreenDisplay
-
dispose
public void dispose()Disposes arrow textures and then delegates toBaseScreenDisplay.dispose()
. Subclasses should ensure UI actors that use textures are detached before disposal.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classBaseScreenDisplay
-