|
GTGE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.golden.gamedev.object.font.BitmapFont
com.golden.gamedev.object.font.AdvanceBitmapFont
public class AdvanceBitmapFont
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 |
---|
public AdvanceBitmapFont(BufferedImage[] imagefont, String letterSequence)
AdvanceBitmapFont
with specified images font and
letter sequence.
imagefont
- the images font, all images must have same heightletterSequence
- the order sequence of the images fontpublic AdvanceBitmapFont(BufferedImage[] imagefont)
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 { | } ~
imagefont
- the images font, all images must have same heightMethod Detail |
---|
public void setImageFont(BufferedImage[] imagefont, String letterSequence)
BitmapFont
setImageFont
in class BitmapFont
public int getWidth(char c)
GameFont
char c
in pixel.
getWidth
in interface GameFont
getWidth
in class BitmapFont
public int getWidth(String st)
GameFont
String st
in pixel.
getWidth
in interface GameFont
getWidth
in class BitmapFont
|
GTGE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |