Class MapFont
java.lang.Object
studio.magemonkey.codex.mccore.gui.MapFont
Represents a font that can more efficiently draw to a map canvas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstudio.magemonkey.codex.mccore.gui.MapFont.MapChargetChar(char c) Gets data for a character from the font.getFont()Retrieves the font wrapped by this objectintgetSpace()Retrieves the spacing between letters for this fontint[]measureString(String str) Measures the dimensions of a string
-
Constructor Details
-
MapFont
Initializes a MapFont using a Font template- Parameters:
font- font templatespace- spacing between characters
-
-
Method Details
-
getFont
Retrieves the font wrapped by this object- Returns:
- wrapped font
-
getSpace
public int getSpace()Retrieves the spacing between letters for this font- Returns:
- spacing between letters
-
measureString
Measures the dimensions of a string- Parameters:
str- string to measure- Returns:
- the dimensions of the string { width, height, yOffset }
-
getChar
public studio.magemonkey.codex.mccore.gui.MapFont.MapChar getChar(char c) Gets data for a character from the font. If the character is not initialized, it will be initialized first.- Parameters:
c- character to get the data of- Returns:
- character data for the font
-