Class PausableScreen

java.lang.Object
com.badlogic.gdx.ScreenAdapter
com.csse3200.game.screens.PausableScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen
Direct Known Subclasses:
MainGameScreen, MiniGameScreen

public class PausableScreen extends com.badlogic.gdx.ScreenAdapter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final GdxGame
    Reference to the main game instance.
    protected boolean
    Flag indicating whether the screen is in a resting state.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an overlay to the screen.
    void
     
    void
    Removes the topmost overlay from the screen.
    void
    Puts the screen into a resting state, pausing music and resting all entities.
    void
    Wakes the screen from a resting state.

    Methods inherited from class com.badlogic.gdx.ScreenAdapter

    dispose, hide, pause, render, resize, resume, show

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • game

      protected final GdxGame game
      Reference to the main game instance.
    • resting

      protected boolean resting
      Flag indicating whether the screen is in a resting state.
  • Constructor Details

    • PausableScreen

      public PausableScreen(GdxGame game)
  • Method Details

    • addOverlay

      public void addOverlay(Overlay.OverlayType overlayType)
      Adds an overlay to the screen.
      Parameters:
      overlayType - The type of overlay to add.
    • addSnakePopupOverlay

      public void addSnakePopupOverlay(String texturePath)
    • removeOverlay

      public void removeOverlay()
      Removes the topmost overlay from the screen.
    • rest

      public void rest()
      Puts the screen into a resting state, pausing music and resting all entities.
    • wake

      public void wake()
      Wakes the screen from a resting state.