|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object game.graphics.image.CImageProcessor game.graphics.text.CBitmapFont
public class CBitmapFont
Variable width font constructed from an image.
Field Summary | |
---|---|
private int[] |
m_aCharOffsets
|
private boolean |
m_bNoLowerCase
|
private int |
m_charHeight
|
private int |
m_firstChar
|
private java.awt.Image[] |
m_imgChars
|
private int |
m_quadratin
|
private int |
m_space
|
private int |
m_tabSize
|
private int |
m_thinSpace
|
Fields inherited from class game.graphics.image.CImageProcessor |
---|
A_MASK, A_OFFSET, B_MASK, B_OFFSET, BYTE_MASK, G_MASK, G_OFFSET, H, m_aBasePixels, m_bufferedImage, R_MASK, R_OFFSET, RGB_MASK, SCAN_SIZE, W |
Constructor Summary | |
---|---|
CBitmapFont(CBitmapFont rhs)
Copy a font. |
|
CBitmapFont(java.awt.Image imgFont)
Constructs a variable width font from an image. |
Method Summary | |
---|---|
private void |
applyGradient()
|
void |
drawString(java.awt.Graphics g,
java.lang.String str,
int x,
int y)
Draws a string. |
private int |
getCharIndex(char c)
Returns the index of the char in the image array. |
private int |
getCharWidth(int index)
Retrieves a char width assuming it has an image. |
int |
getHeight()
|
private int |
getSpaceWidth(char c)
Returns a whitespace (eg. ' ' or '\t') width, assuming c represents a whitespace. |
int |
getStringWidth(java.lang.String str)
String measuring tool. |
private void |
init()
Inits char width and spacing relative data. |
Methods inherited from class game.graphics.image.CImageProcessor |
---|
affineTransform, affineTransformAA, colorAdd, colorFilter, convolve, createARGBImage, createCompatibleImage, drawImage, fourCornersGradient, getA, getARGB, getB, getBlurKernel, getBufferedImage, getEdgeKernel, getEmbossKernel, getG, getGaussianBlurKernel, getGraphics, getImageOffsets, getR, getSharpenKernel, interleave, invert, mul, mul, mul, restablishTransparency, rotate, rotate, safeComponent, saveCurrentPixels, scrollH, setAlpha, split, split, wave, zoom, zoom |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.awt.Image[] m_imgChars
private int[] m_aCharOffsets
private boolean m_bNoLowerCase
private final int m_firstChar
private int m_quadratin
private final int m_thinSpace
private int m_space
private final int m_tabSize
private int m_charHeight
Constructor Detail |
---|
public CBitmapFont(java.awt.Image imgFont)
imgFont
- the image containing the chars' graphics.public CBitmapFont(CBitmapFont rhs)
rhs
- Method Detail |
---|
private final void init()
public final int getStringWidth(java.lang.String str)
str
-
public final int getHeight()
private final int getCharIndex(char c)
c
- the char whom index you seek
private final int getCharWidth(int index)
index
- the index of the char in the image array.
private final int getSpaceWidth(char c)
c
-
public void drawString(java.awt.Graphics g, java.lang.String str, int x, int y)
g
- the Graphics to draw tostr
- the text to be drawnx
- where to (upper left corner)y
- idemprivate final void applyGradient()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |