Class GUITheme

java.lang.Object
com.blackrook.gui.GUITheme

public class GUITheme extends Object
GUI theme for objects and whole GUI layers.
Author:
Matthew Tropiano
  • Field Details

  • Constructor Details

    • GUITheme

      public GUITheme(String name)
      Creates a new theme.
      Parameters:
      name - the name of the theme.
  • Method Details

    • set

      public void set(String key, String texture)
      Sets a theme skin by key. Re-setting an existing key replaces it.
      Parameters:
      key - the theme key.
      texture - the texture to use. if null, the key is removed.
    • set

      public void set(String key, GUIFontType font)
      Sets a theme font by key. Re-setting an existing key replaces it.
      Parameters:
      key - the theme key.
      font - the skin to use. if null, the key is removed.
    • getTexture

      public String getTexture(String key)
      Returns a texture associated with a theme key, or null if not a texture or none is associated.
      Parameters:
      key - the key to use.
      Returns:
      the corresponding texture name, or null if none found or if the value at this key is not a texture.
    • getFont

      public GUIFontType getFont(String key)
      Returns a font associated with a theme key, or null if not a font or none is associated.
      Parameters:
      key - the key to use.
      Returns:
      the corresponding font, or null if none found or if the value at this key is not a font.