Package com.csse3200.game.ui
Class ButtonFactory
java.lang.Object
com.csse3200.game.ui.ButtonFactory
Factory class for creating standardized buttons using the btn-blue texture atlas.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.badlogic.gdx.scenes.scene2d.ui.TextButton
createButton
(String text) 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
createDialogButton
(String text) Creates a dialog TextButton with specific styling for dialog boxes.static com.badlogic.gdx.scenes.scene2d.ui.TextButton
createLargeButton
(String text) Creates a large TextButton using the standard btn-blue texture atlas.static com.badlogic.gdx.scenes.scene2d.ui.TextButton
createSmallButton
(String text) Creates a small TextButton using the standard btn-blue texture atlas.
-
Method Details
-
createButton
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
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
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
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 buttonfontScale
- 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 buttonfontScale
- 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
-