public final class Resources
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_BUNDLE |
static java.lang.String |
ENCODING_ISO_8859_1 |
static java.lang.String |
ENCODING_UTF_8 |
static java.lang.String |
LOCALIZATION_RESOURCE_FOLDER |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(java.lang.String key) |
static boolean |
contains(java.lang.String bundleName,
java.lang.String key) |
static java.lang.String |
get(java.lang.String key) |
static java.lang.String |
get(java.lang.String key,
java.lang.Object... args) |
static java.awt.Font |
getFont(java.lang.String fontName)
Loads a custom font with the specified name from game's resources and registers it on the
GraphicsEnvironment. |
static java.lang.String |
getFrom(java.lang.String bundleName,
java.lang.String key,
java.lang.Object... args) |
static java.awt.image.BufferedImage |
getImage(java.lang.String absolutPath) |
static java.awt.image.BufferedImage |
getImage(java.lang.String absolutPath,
boolean forceLoad)
Gets the image by the specified relative path.
|
static java.lang.String[] |
getStringList(java.lang.String textFile)
Get a list of strings from the specified raw text files.
|
static void |
setEncoding(java.lang.String newEncoding) |
public static final java.lang.String LOCALIZATION_RESOURCE_FOLDER
public static final java.lang.String DEFAULT_BUNDLE
public static final java.lang.String ENCODING_ISO_8859_1
public static final java.lang.String ENCODING_UTF_8
public static void setEncoding(java.lang.String newEncoding)
public static boolean contains(java.lang.String key)
public static boolean contains(java.lang.String bundleName,
java.lang.String key)
public static java.lang.String get(java.lang.String key)
public static java.lang.String get(java.lang.String key,
java.lang.Object... args)
public static java.lang.String getFrom(java.lang.String bundleName,
java.lang.String key,
java.lang.Object... args)
public static java.awt.image.BufferedImage getImage(java.lang.String absolutPath)
public static java.awt.image.BufferedImage getImage(java.lang.String absolutPath,
boolean forceLoad)
absolutPath - The path to the image.forceLoad - Forces the image to be reloaded. Cached values will be ignored.public static java.lang.String[] getStringList(java.lang.String textFile)
InputStream to read the strings from the text file.textFile - The text file that will be retrieved.public static java.awt.Font getFont(java.lang.String fontName)
GraphicsEnvironment.
As a fallback, when no font could be found by the specified fontName, it tries to get the font from the environment by calling.fontName - The name of the fontGraphicsEnvironment.registerFont(Font),
Font.createFont(int, java.io.File),
Font.getFont(String)