com.golden.gamedev.object.font
Class AdvanceBitmapFont

java.lang.Object
  |
  +--com.golden.gamedev.object.font.BitmapFont
        |
        +--com.golden.gamedev.object.font.AdvanceBitmapFont
All Implemented Interfaces:
GameFont

public class AdvanceBitmapFont
extends BitmapFont


Field Summary
 
Fields inherited from interface com.golden.gamedev.object.GameFont
CENTER, JUSTIFY, LEFT, RIGHT
 
Constructor Summary
AdvanceBitmapFont(BufferedImage[] imagefont)
          Constructs new AdvanceBitmapFont with specified images.
 
Method Summary
 int getWidth(char c)
          Returns width of char c using this font.
 int getWidth(String st)
          Returns width of String st using this font.
 
Methods inherited from class com.golden.gamedev.object.font.BitmapFont
drawString, drawString, drawText, getHeight, getImageFont, getImageFont, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdvanceBitmapFont

public AdvanceBitmapFont(BufferedImage[] imagefont)
Constructs new AdvanceBitmapFont with specified images. Use this if the bitmap font have different size.
If the bitmap have equal size use standard BitmapFont.

The right image font sequence:

         ! " # $ % & ' ( ) * + , - . / 0 1 2 3
       4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
       H I J K L M N O P Q R S T U V W X Y Z [
       \ ] ^ _ ' a b c d e f g h i j k l m n o
       p q r s t u v w x y z { | } ~
 

Parameters:
imagefont - font images in sequence, all font height must same
See Also:
BitmapFont
Method Detail

getWidth

public int getWidth(char c)
Description copied from interface: GameFont
Returns width of char c using this font.

Specified by:
getWidth in interface GameFont
Overrides:
getWidth in class BitmapFont
Returns:
char width, in pixel

getWidth

public int getWidth(String st)
Description copied from interface: GameFont
Returns width of String st using this font.

Specified by:
getWidth in interface GameFont
Overrides:
getWidth in class BitmapFont
Returns:
String width, in pixel