Package com.csse3200.game.ui
Class ButtonFactory
java.lang.Object
com.csse3200.game.ui.ButtonFactory
This class provides static methods for creating various types of TextButtons with different styles.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.badlogic.gdx.scenes.scene2d.ui.TextButton
createButton
(String text) Creates a TextButton with the specified text using the default skin.static com.badlogic.gdx.scenes.scene2d.ui.TextButton
createCustomButton
(String text, String customImagePath) Creates a custom TextButton with the specified text and a custom image.static com.badlogic.gdx.scenes.scene2d.ui.TextButton
createCustomButtonWithAtlas
(String text, String atlasPath) Creates a custom TextButton with the specified text and an image from a TextureAtlas.
-
Constructor Details
-
ButtonFactory
public ButtonFactory()
-
-
Method Details
-
createButton
Creates a TextButton with the specified text using the default skin.- Parameters:
text
- The text to display on the button.- Returns:
- The created TextButton.
-
createCustomButton
public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createCustomButton(String text, String customImagePath) Creates a custom TextButton with the specified text and a custom image.- Parameters:
text
- The text to display on the button.customImagePath
- The path to the custom image for the button.- Returns:
- The created custom TextButton.
-
createCustomButtonWithAtlas
public static com.badlogic.gdx.scenes.scene2d.ui.TextButton createCustomButtonWithAtlas(String text, String atlasPath) Creates a custom TextButton with the specified text and an image from a TextureAtlas.- Parameters:
text
- The text to display on the button.atlasPath
- The path to the TextureAtlas containing the button image.- Returns:
- The created custom TextButton.
-