GTGE API

com.golden.gamedev.object.font
Class AdvanceBitmapFont

java.lang.Object
  extended by com.golden.gamedev.object.font.BitmapFont
      extended by com.golden.gamedev.object.font.AdvanceBitmapFont
All Implemented Interfaces:
GameFont

public class AdvanceBitmapFont
extends BitmapFont

Game font that use images for the letter, each images can have different width but must have same height.

AdvanceBitmapFont takes up two parameters, the array of images font and the sequence of the images, for example if the images font array sequence is ordered as follow: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", specify the parameter letter sequence as is.

If the images font have same width, use the standard BitmapFont.


Field Summary
 
Fields inherited from class com.golden.gamedev.object.font.BitmapFont
charIndex
 
Fields inherited from interface com.golden.gamedev.object.GameFont
CENTER, JUSTIFY, LEFT, RIGHT
 
Constructor Summary
AdvanceBitmapFont(BufferedImage[] imagefont)
          Creates new AdvanceBitmapFont with specified images font and default letter sequence : !
AdvanceBitmapFont(BufferedImage[] imagefont, String letterSequence)
          Creates new AdvanceBitmapFont with specified images font and letter sequence.
 
Method Summary
 int getWidth(char c)
          Returns the width of char c in pixel.
 int getWidth(String st)
          Returns the width of String st in pixel.
 void setImageFont(BufferedImage[] imagefont, String letterSequence)
          Sets images font to draw this bitmap font.
 
Methods inherited from class com.golden.gamedev.object.font.BitmapFont
drawString, drawString, drawText, getHeight, getImageFont, isAvailable, 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,
                         String letterSequence)
Creates new AdvanceBitmapFont with specified images font and letter sequence.

Parameters:
imagefont - the images font, all images must have same height
letterSequence - the order sequence of the images font

AdvanceBitmapFont

public AdvanceBitmapFont(BufferedImage[] imagefont)
Creates new AdvanceBitmapFont with specified images font and default letter 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 - the images font, all images must have same height
Method Detail

setImageFont

public void setImageFont(BufferedImage[] imagefont,
                         String letterSequence)
Description copied from class: BitmapFont
Sets images font to draw this bitmap font.

Overrides:
setImageFont in class BitmapFont

getWidth

public int getWidth(char c)
Description copied from interface: GameFont
Returns the width of char c in pixel.

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 the width of String st in pixel.

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

GTGE API

Copyright © 2003-2005 Golden T Studios. All rights reserved. Use is subject to license terms.
GoldenStudios.or.id