Class Fonts
java.lang.Object
de.gurkenlabs.litiengine.resources.ResourcesContainer<Font>
de.gurkenlabs.litiengine.resources.Fonts
A container class for managing font resources. This class extends the ResourcesContainer class, specifically for Font objects.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a font with the specified name and size.Retrieves a font with the specified name and style.Retrieves a font with the specified name, style, and size.protected FontLoads a custom font with the specified name from game's resources.Methods inherited from class ResourcesContainer
add, add, addClearedListener, addContainerListener, clear, contains, contains, contains, count, get, get, get, get, get, get, get, getAlias, getAll, getAsync, getAsync, getResources, remove, remove, removeClearedListener, removeContainerListener, tryGet, tryGet
-
Method Details
-
get
-
get
-
get
Retrieves a font with the specified name, style, and size.- Parameters:
name- The name of the font.style- The style of the font (e.g., Font.PLAIN, Font.BOLD).size- The size of the font.- Returns:
- The derived font with the specified style and size, or null if the font is not found.
-
load
Loads a custom font with the specified name from game's resources. As a fallback, when no font could be found by the specifiedfontName, it tries to get the font from the environment by calling.- Specified by:
loadin classResourcesContainer<Font>- Parameters:
resourceName- The name of the font- Returns:
- The loaded font.
- See Also:
-