|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.renderer.lwjgl.LWJGLFont
public class LWJGLFont
Font2D
maintains display lists for each ASCII character
defined by an image. Font2D
assumes that the texture is
256x256 and that the characters are 16 pixels high by 16 pixels wide. The
order of the characters is also important:
After the font is loaded, it can be used with a call to print
.
The Font2D
class is also printed in Ortho mode and
billboarded, as well as depth buffering turned off. This means that the font
will be placed at a two dimensional coordinate that corresponds to screen
coordinates.
The users is assumed to set a TextureState to the Text Geometry calling this
class.
Text
,
TextureState
Field Summary | |
---|---|
static int |
ITALICS
Sets the style of the font to italics. |
static int |
NORMAL
Sets the style of the font to normal. |
Constructor Summary | |
---|---|
LWJGLFont()
Constructor instantiates a new LWJGLFont object. |
Method Summary | |
---|---|
void |
buildDisplayList()
buildDisplayList sets up the 256 display lists that are
used to render each font character. |
void |
deleteFont()
deleteFont deletes the current display list of font
objects. |
void |
print(Renderer r,
float x,
float y,
Vector3f scale,
java.lang.StringBuffer text,
int set)
print renders the specified string to a given (x,y)
location. |
void |
setColor(ColorRGBA color)
setColor sets the RGBA values to render the font as. |
java.lang.String |
toString()
toString returns the string representation of this font
object in the Format: jme.geometry.hud.text.Font2D@1c282a1 Color: {RGBA COLOR} |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NORMAL
public static final int ITALICS
Constructor Detail |
---|
public LWJGLFont()
LWJGLFont
object. The
initial color is set to white.
Method Detail |
---|
public void deleteFont()
deleteFont
deletes the current display list of font
objects. The font will be useless until a call to
buildDisplayLists
is made.
public void setColor(ColorRGBA color)
setColor
sets the RGBA values to render the font as. By
default the color is white with no transparency.
color
- the color to set.public void print(Renderer r, float x, float y, Vector3f scale, java.lang.StringBuffer text, int set)
print
renders the specified string to a given (x,y)
location. The x, y location is in terms of screen coordinates. There are
currently two sets of fonts supported: NORMAL and ITALICS.
r
- x
- the x screen location to start the string render.y
- the y screen location to start the string render.text
- the String to render.set
- the mode of font: NORMAL or ITALICS.public void buildDisplayList()
buildDisplayList
sets up the 256 display lists that are
used to render each font character. Each list quad is 16x16, as defined
by the font image size.
public java.lang.String toString()
toString
returns the string representation of this font
object in the Format:
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |