Class UIUtils
java.lang.Object
net.dermetfan.gdx.scenes.scene2d.ui.UIUtils
public class UIUtils
extends java.lang.Object
Provides useful methods for
com.badlogic.gdx.scenes.scene2d.ui
.- Since:
- 0.7.1
-
Constructor Summary
Constructors Constructor Description UIUtils()
-
Method Summary
Modifier and Type Method Description static void
layoutSize(com.badlogic.gdx.scenes.scene2d.ui.Widget widget)
Deprecated.seems unnecessary and with no known use casestatic com.badlogic.gdx.scenes.scene2d.ui.Button
newButton(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style)
static com.badlogic.gdx.scenes.scene2d.ui.Button
newButton(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style, java.lang.String textIfAny)
creates aButton
according to the givenButton.ButtonStyle
instance that may beButton.ButtonStyle
,TextButton.TextButtonStyle
,ImageButton.ImageButtonStyle
orImageTextButton.ImageTextButtonStyle
static com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle
readButtonStyle(java.lang.String name, com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonValue)
Tries to load aTextButton.TextButtonStyle
, thenImageButton.ImageButtonStyle
, thenImageTextButton.ImageTextButtonStyle
and thenButton.ButtonStyle
usingJson.readValue(String, Class, JsonValue)
brutally by catching NPEs.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
UIUtils
public UIUtils()
-
-
Method Details
-
layoutSize
@Deprecated public static void layoutSize(com.badlogic.gdx.scenes.scene2d.ui.Widget widget)Deprecated.seems unnecessary and with no known use case- Parameters:
widget
- the Widget to resize according to its min, pref and max size
-
newButton
public static com.badlogic.gdx.scenes.scene2d.ui.Button newButton(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style)- See Also:
newButton(Button.ButtonStyle, String)
-
newButton
public static com.badlogic.gdx.scenes.scene2d.ui.Button newButton(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style, java.lang.String textIfAny)creates aButton
according to the givenButton.ButtonStyle
instance that may beButton.ButtonStyle
,TextButton.TextButtonStyle
,ImageButton.ImageButtonStyle
orImageTextButton.ImageTextButtonStyle
-
readButtonStyle
public static com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle readButtonStyle(java.lang.String name, com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonValue)Tries to load aTextButton.TextButtonStyle
, thenImageButton.ImageButtonStyle
, thenImageTextButton.ImageTextButtonStyle
and thenButton.ButtonStyle
usingJson.readValue(String, Class, JsonValue)
brutally by catching NPEs. Nasty...
-