org.bukkit.map
Class MapFont

java.lang.Object
  extended by org.bukkit.map.MapFont
Direct Known Subclasses:
MinecraftFont

public class MapFont
extends Object

Represents a bitmap font drawable to a map.


Nested Class Summary
static class MapFont.CharacterSprite
          Represents the graphics for a single character in a MapFont.
 
Field Summary
protected  boolean malleable
           
 
Constructor Summary
MapFont()
           
 
Method Summary
 MapFont.CharacterSprite getChar(char ch)
          Get the sprite for a given character.
 int getHeight()
          Get the height of this font.
 int getWidth(String text)
          Get the width of the given text as it would be rendered using this font.
 boolean isValid(String text)
          Check whether the given text is valid.
 void setChar(char ch, MapFont.CharacterSprite sprite)
          Set the sprite for a given character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

malleable

protected boolean malleable
Constructor Detail

MapFont

public MapFont()
Method Detail

setChar

public void setChar(char ch,
                    MapFont.CharacterSprite sprite)
Set the sprite for a given character.

Parameters:
ch - The character to set the sprite for.
sprite - The CharacterSprite to set.
Throws:
IllegalStateException - if this font is static.

getChar

public MapFont.CharacterSprite getChar(char ch)
Get the sprite for a given character.

Parameters:
ch - The character to get the sprite for.
Returns:
The CharacterSprite associated with the character, or null if there is none.

getWidth

public int getWidth(String text)
Get the width of the given text as it would be rendered using this font.

Parameters:
text - The text.
Returns:
The width in pixels.

getHeight

public int getHeight()
Get the height of this font.

Returns:
The height of the font.

isValid

public boolean isValid(String text)
Check whether the given text is valid.

Parameters:
text - The text.
Returns:
True if the string contains only defined characters, false otherwise.


Copyright © 2014. All rights reserved.