Package view.overlays.gameOverlays
Class GameOverlayView
java.lang.Object
view.overlays.gameOverlays.GameOverlayView
- Direct Known Subclasses:
GameCompletedOverlayView,GameOverOverlayView,GamePausedOverlayView
Abstract class representing the base structure of a game overlay view.
Handles the drawing of the overlay, including the title and control instructions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final Fontprotected final PlayingModelprotected final Font -
Constructor Summary
ConstructorsConstructorDescriptionGameOverlayView(PlayingModel playingModel) Constructs a GameOverlayView with the specified PlayingModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidDraws the overlay on the screen.protected abstract voidDraws the control instructions of the overlay.protected abstract voidDraws the title of the overlay.voidreset()Resets the overlay state for a new update.protected abstract voidsetAudio()Sets the audio for the overlay.
-
Field Details
-
playingModel
-
nesFont
-
retroFont
-
firstUpdate
protected boolean firstUpdate
-
-
Constructor Details
-
GameOverlayView
Constructs a GameOverlayView with the specified PlayingModel. Initializes the fonts used in the overlay.- Parameters:
playingModel- the model of the playing state
-
-
Method Details
-
draw
Draws the overlay on the screen. Sets the background color, audio, title, and control instructions.- Parameters:
g- the Graphics object to draw with
-
reset
public void reset()Resets the overlay state for a new update. Sets the firstUpdate flag to true. -
drawTitle
Draws the title of the overlay.- Parameters:
g- the Graphics object to draw with
-
drawControls
Draws the control instructions of the overlay.- Parameters:
g- the Graphics object to draw with
-
setAudio
protected abstract void setAudio()Sets the audio for the overlay.
-