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 case
    static 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 a Button according to the given Button.ButtonStyle instance that may be Button.ButtonStyle, TextButton.TextButtonStyle, ImageButton.ImageButtonStyle or ImageTextButton.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 a TextButton.TextButtonStyle, then ImageButton.ImageButtonStyle, then ImageTextButton.ImageTextButtonStyle and then Button.ButtonStyle using Json.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 a Button according to the given Button.ButtonStyle instance that may be Button.ButtonStyle, TextButton.TextButtonStyle, ImageButton.ImageButtonStyle or ImageTextButton.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 a TextButton.TextButtonStyle, then ImageButton.ImageButtonStyle, then ImageTextButton.ImageTextButtonStyle and then Button.ButtonStyle using Json.readValue(String, Class, JsonValue) brutally by catching NPEs. Nasty...