K
- key typepublic abstract class MapFont<K> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MapFont.Alignment
The alignment of the characters when drawn on a canvas
|
Modifier and Type | Field and Description |
---|---|
static MapFont<Character> |
MINECRAFT
Standard Minecraft font (5x7), only supports standard ASCII characters
|
static MapFont<Character> |
TINY
Tiny font (3x5), only supports standard ASCII characters
|
Constructor and Description |
---|
MapFont() |
Modifier and Type | Method and Description |
---|---|
static MapFont<Character> |
fromBukkitFont(org.bukkit.map.MapFont font)
Creates a new font from a bukkit map font
|
static MapFont<Character> |
fromJavaFont(Font font)
Creates a new font from a system Java AWT font
|
static MapFont<Character> |
fromJavaFont(String name,
int size)
Creates a new font from a system Java AWT font from a family name and size.
|
static MapFont<Character> |
fromJavaFont(String name,
int style,
int size)
Creates a new font from a system Java AWT font from a family name, font style and size.
|
MapTexture |
getSprite(K key)
Retrieves the sprite texture mapped to a certain key
|
boolean |
isNewline(K key)
Gets whether a particular key acts as a newline character.
|
protected MapTexture |
loadNullSprite()
Loads the sprite texture for null keys.
|
protected abstract MapTexture |
loadSprite(K key)
Loads the sprite texture for a given key.
|
void |
reload()
Resets the sprite cache, requiring a reload of all sprites upon first use
|
public static final MapFont<Character> MINECRAFT
protected abstract MapTexture loadSprite(K key)
key
- to get the sprite forprotected MapTexture loadNullSprite()
public final MapTexture getSprite(K key)
key
- texture is bound topublic boolean isNewline(K key)
key
- to checkpublic void reload()
public static MapFont<Character> fromBukkitFont(org.bukkit.map.MapFont font)
font
- to convertpublic static MapFont<Character> fromJavaFont(Font font)
font
- to convertpublic static MapFont<Character> fromJavaFont(String name, int style, int size)
name
- of the fontstyle
- of the fontsize
- of the fontCopyright © 2019. All rights reserved.