Class ButtonFactory

java.lang.Object
com.csse3200.game.ui.ButtonFactory

public class ButtonFactory extends Object
Factory class for creating standardized buttons using the btn-blue texture atlas.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.badlogic.gdx.scenes.scene2d.ui.TextButton
    Creates a TextButton using the standard btn-blue texture atlas.
    static com.badlogic.gdx.scenes.scene2d.ui.TextButton
    createButton(String text, float fontScale)
    Creates a TextButton using the standard btn-blue texture atlas with custom font scale.
    static com.badlogic.gdx.scenes.scene2d.ui.TextButton
    createButton(String text, float fontScale, com.badlogic.gdx.graphics.g2d.BitmapFont customFont)
    Creates a TextButton using the standard btn-blue texture atlas with custom font.
    static com.badlogic.gdx.scenes.scene2d.ui.TextButton
    Creates a dialog TextButton with specific styling for dialog boxes.
    static com.badlogic.gdx.scenes.scene2d.ui.TextButton
    Creates a large TextButton using the standard btn-blue texture atlas.
    static com.badlogic.gdx.scenes.scene2d.ui.TextButton
    Creates a small TextButton using the standard btn-blue texture atlas.

    Methods inherited from class java.lang.Object

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

    • createButton

      public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createButton(String text)
      Creates a TextButton using the standard btn-blue texture atlas.
      Parameters:
      text - The text to display on the button
      Returns:
      A TextButton with the btn-blue styling
    • createSmallButton

      public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createSmallButton(String text)
      Creates a small TextButton using the standard btn-blue texture atlas.
      Parameters:
      text - The text to display on the button
      Returns:
      A TextButton with smaller font styling and 3f left/right padding
    • createLargeButton

      public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createLargeButton(String text)
      Creates a large TextButton using the standard btn-blue texture atlas.
      Parameters:
      text - The text to display on the button
      Returns:
      A TextButton with larger font styling and 5f left/right padding
    • createDialogButton

      public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createDialogButton(String text)
      Creates a dialog TextButton with specific styling for dialog boxes.
      Parameters:
      text - The text to display on the button
      Returns:
      A TextButton styled for dialogs with wider width and 1.5f font scale
    • createButton

      public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createButton(String text, float fontScale)
      Creates a TextButton using the standard btn-blue texture atlas with custom font scale.
      Parameters:
      text - The text to display on the button
      fontScale - The scale factor for the font
      Returns:
      A TextButton with the btn-blue styling
    • createButton

      public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createButton(String text, float fontScale, com.badlogic.gdx.graphics.g2d.BitmapFont customFont)
      Creates a TextButton using the standard btn-blue texture atlas with custom font.
      Parameters:
      text - The text to display on the button
      fontScale - The scale factor for the font (ignored if customFont is provided)
      customFont - The custom font to use, or null to use global font
      Returns:
      A TextButton with the btn-blue styling