Class PopUpHelper

java.lang.Object
com.csse3200.game.ui.pop_up_dialog_box.PopUpHelper

public class PopUpHelper extends Object
A helper class for displaying popup dialogs. Provides a simple interface for creating and showing a PopupDialogBox with a single page of content.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PopUpHelper(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage)
    Constructs a new PopUpHelper.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    displayDialog(String title, String content, String animalImagePath, float width, float height, int animalIndex)
     
    void
    displayDialog(String title, String content, String animalImagePath, float width, float height, int animalIndex, Runnable callback)
    Displays a popup dialog with the specified title, content, animal image, and dimensions.

    Methods inherited from class java.lang.Object

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

    • PopUpHelper

      public PopUpHelper(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage)
      Constructs a new PopUpHelper.
      Parameters:
      skin - The skin to be used for the UI elements in the dialog.
      stage - The stage on which to display the dialog.
  • Method Details

    • displayDialog

      public void displayDialog(String title, String content, String animalImagePath, float width, float height, int animalIndex, Runnable callback)
      Displays a popup dialog with the specified title, content, animal image, and dimensions.
      Parameters:
      title - The title of the dialog.
      content - The content to be displayed in the dialog.
      animalImagePath - Path to the image of the animal to be displayed.
      width - The width of the dialog box.
      height - The height of the dialog box.
      animalIndex - The index of the selected animal (0 for bird, 1 for croc, 2 for dog).
      callback - A Runnable to be executed when the dialog is closed.
    • displayDialog

      public void displayDialog(String title, String content, String animalImagePath, float width, float height, int animalIndex)